Skip to content

This ansible role adds and enables a reverse proxy configuration to an existing nginx instance.

License

Notifications You must be signed in to change notification settings

anarres-org/add_nginx_proxy_conf

Repository files navigation

Add nginx proxy configuration

This role adds and enables a reverse proxy configuration to an existing nginx instance.

Requirements

  • nginx

  • An SSL cert for the domain.

  • In your local machine:

    pip install -r requirements.txt

Role Variables

  • domain: domain (or subdomain) for the reverse proxy to bind to.
  • binded_port: Internal binded port of the service we want the proxy to reach .
  • external_port: External binded port through which the proxy will be accessible (with SSL/TLS).
  • ssl_certificate: Path to the SSL cert file.
  • ssl_certificate_key: Path to the SSL private key file.
  • template_path: Path to the template for the nginx vhost configuration.

Dependencies

None.

Example Playbook

- name: Add nginx proxy configuration
  hosts: all
  vars:
    binded_port: 8000
    domain: anarres.local
  roles:
    - role: add_nginx_proxy_conf

Note: by default this role will use the SSL cert files found in /etc/letsencrypt/live/{{ domain }}/.

Testing

To test the role you need molecule, docker and some python requirements that can be installed wwith pip install -r requirements-dev.txt.

molecule test

or

make test

License

GPLv3

Author Information

  • m0wer: m0wer (at) autistici (dot) org

About

This ansible role adds and enables a reverse proxy configuration to an existing nginx instance.

Resources

License

Stars

Watchers

Forks