diff options
author | Christian Pointner <equinox@spreadspace.org> | 2023-10-09 22:19:57 +0200 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2023-10-09 22:19:57 +0200 |
commit | ee2555abe7767818295bd04334e5d6b6c3de5a0d (patch) | |
tree | 81904d68c70f77f75ae05faa37cc613df0e39437 /roles/nginx/vhost/templates/tlsonly.conf.j2 | |
parent | nginx/vhost: refactor templates and add tlsonly variant (diff) |
nginx/vhost: make listen addresses configurable
Diffstat (limited to 'roles/nginx/vhost/templates/tlsonly.conf.j2')
-rw-r--r-- | roles/nginx/vhost/templates/tlsonly.conf.j2 | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/roles/nginx/vhost/templates/tlsonly.conf.j2 b/roles/nginx/vhost/templates/tlsonly.conf.j2 index 2af0e7ad..122e2f4f 100644 --- a/roles/nginx/vhost/templates/tlsonly.conf.j2 +++ b/roles/nginx/vhost/templates/tlsonly.conf.j2 @@ -1,7 +1,8 @@ server { - listen {{ nginx_vhost.tls.port | default(443) }} ssl http2{% if 'default' in nginx_vhost and nginx_vhost.default %} default_server{% endif %}; - listen [::]:{{ nginx_vhost.tls.port | default(443) }} ssl http2{% if 'default' in nginx_vhost and nginx_vhost.default %} default_server{% endif %}; - server_name {{ nginx_vhost.hostnames | join(' ') }}; +{% for listen in (nginx_vhost.tls.listen | default(['443', '[::]:443'])) %} + listen {{ listen }} ssl http2{% if 'default' in nginx_vhost and nginx_vhost.default %} default_server{% endif %}; +{% endfor %} + server_name {{ nginx_vhost.hostnames | default(['_']) | join(' ') }}; {% if 'logs' in nginx_vhost %} {% if 'access' in nginx_vhost.logs %} |