letsencrypt-nginx-revproxy

ansible-letsencrypt-nginx-revproxy

Build Status Galaxy

Configures Nginx as reverse proxy for multiple website with Let's Encrypt certificate.

Requirements

This role requires Ansible 1.9 or higher.

Role Variables

Default values:

nginx_revproxy_sites:                                         # List of sites to reverse proxy
  example.com:                                                # Domain name
    domains:                                                  # List of server_name aliases
      - example.com
      - www.example.com
    upstreams:                                                # List of Upstreams
      - { backend_address: 192.168.0.100, backend_port: 80 }
      - { backend_address: 192.168.0.101, backend_port: 8080 }
    letsencrypt: true                                        # Set to True if you are using hispanico.letsencrypt-nginx-revproxy role
    letsencrypt_email: '[email protected]'

Dependencies

Example Playbook

This esample configure nginx as reverse proxy for the following sites:

  • example.org with selfsign ssl certificate
  • example.com ssl certificate generate via let's encrypt ACME protocol.
  - hosts: all
    roles:
      - ansible-nginx-revproxy
      - ansible-letsencrypt-nginx-revproxy
    vars:
      nginx_revproxy_sites:
        example.org:
          domains:
            - example.org
            - www.example.org
          upstreams:
            - { backend_address: 192.168.0.200, backend_port: 80 }
            - { backend_address: 192.168.0.201, backend_port: 80 }
          letsencrypt: false

        example.com:
          domains:
            - example.com
            - www.example.com
          upstreams:
            - { backend_address: 192.168.0.100, backend_port: 80 }
            - { backend_address: 192.168.0.101, backend_port: 80 }
          letsencrypt: true

License

Licensed under the GPLv3 License. See the LICENSE file for details.

Author Information

Hispanico

About

Manage Nginx as Reverse Proxy

Install
ansible-galaxy install hispanico/ansible-letsencrypt-nginx-revproxy
GitHub repository
License
Unknown
Downloads
189
Owner
@openwisp Contributor and @ninuxorg Member