acez.nginx
nginx
This role sets up an nginx container that supports self-signed SSL certificates and Let's Encrypt wildcard certificates using a DNS challenge.
Limitations
The DNS challenge currently works only with netcup DNS and supports only one domain, which you set using nginx_config_netcup_domain
.
Requirements
You need to have Docker and all its dependencies installed on the target machine for this role to work.
Role Variables
Config Key | Description | Values | Default |
---|---|---|---|
nginx_container_name | Name of the nginx container. | nginx | |
nginx_container_networks | Docker networks for the nginx container. | ||
nginx_image_name | Custom nginx image name (if needed). | nginx | |
nginx_image_tag | Tag for the nginx image. | stable | |
nginx_config_expose_ports | List of exposed ports in Docker style (e.g. - "80:80"). | - "80:80" - "443:443" |
|
nginx_filesystem_root | Filesystem path for nginx files. | ||
nginx_filesystem_sites | Filesystem path for site configurations. | ||
nginx_filesystem_ssl | Filesystem path for SSL certificates. | ||
nginx_config_cert_email | Email for the SSL certificate. | ||
nginx_config_letsencrypt_dns_challenge_provider | Provider for Let's Encrypt DNS challenge (only netcup is supported). | netcup | |
nginx_config_letsencrypt_account_email | Email account for Let's Encrypt. | ||
nginx_config_letsencrypt_acme_directory | Let's Encrypt ACME directory (can be staging or production). | https://acme-v02.api.letsencrypt.org/directory | |
nginx_config_sites | List of nginx sites. | ||
nginx_config_netcup_api_key | API key for netcup. | ||
nginx_config_netcup_api_password | API password for netcup. | ||
nginx_config_netcup_customer_id | Customer ID for netcup. | ||
nginx_config_netcup_domain | Domain for netcup. |
Variables for nginx_config_sites
Variable | Description | Values | Default |
---|---|---|---|
hostname | Hostname for the site (also used as the filename). | ||
ssl_provider | SSL provider selection. | self-signed, letsencrypt | |
path_config | List of path configurations. |
Variables for path_config
Variable | Description |
---|---|
location | The location for the HTTP site to be configured. |
proxy_pass | Path for proxy_pass. |
configuration | Additional nginx configuration for that path (one-to-one placement in the nginx path configuration). |
Example for nginx_config_sites
nginx_config_sites:
- hostname: my.domain.com
ssl_provider: letsencrypt
path_config:
- location: "/"
proxy_pass: "http://internal-host:8080"
- location: "/my-grafana-installation"
proxy_pass: "http://internal-host-2:3000"
configuration:
- "rewrite /grafana/(.*) /$1 break;"
Dependencies
License
MIT
Installa
ansible-galaxy install acez.nginx
Licenza
mit
Download
190
Proprietario
Developer based in Ulm, Germany