From caa2cba6bf7abf8c52c64348816e5bf1a48b77b3 Mon Sep 17 00:00:00 2001 From: Zolfa Date: Wed, 27 May 2020 15:34:47 +0200 Subject: [PATCH] roles/nginx: add alternate fqdn variable --- roles/nginx/defaults/main.yml | 1 + roles/nginx/meta/main.yaml | 1 + roles/nginx/templates/base.j2 | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/roles/nginx/defaults/main.yml b/roles/nginx/defaults/main.yml index b381c77..3ac2116 100644 --- a/roles/nginx/defaults/main.yml +++ b/roles/nginx/defaults/main.yml @@ -2,5 +2,6 @@ host_fqdn: '{{ ansible_hostname }}.dmz.{{ domain }}' monitoring_vhosts: [] nginx_site_fqdn: '{{ ansible_hostname }}.{{ domain }}' +nginx_site_alternate_fqdns: [] nginx_proxy_protocol: true ... diff --git a/roles/nginx/meta/main.yaml b/roles/nginx/meta/main.yaml index 1ef76c2..d500a93 100644 --- a/roles/nginx/meta/main.yaml +++ b/roles/nginx/meta/main.yaml @@ -2,4 +2,5 @@ dependencies: - role: 'certbot' certbot_site_fqdn: '{{ nginx_site_fqdn }}' + certbot_site_alternate_fqdns: '{{ nginx_site_alternate_fqdns }}' ... diff --git a/roles/nginx/templates/base.j2 b/roles/nginx/templates/base.j2 index c471d29..ecf1c1a 100644 --- a/roles/nginx/templates/base.j2 +++ b/roles/nginx/templates/base.j2 @@ -12,7 +12,7 @@ server { real_ip_header proxy_protocol; {% endif %} - server_name {{ nginx_site_fqdn }}; + server_name {{ nginx_site_fqdn }} {{ nginx_site_alternate_fqdns | join(' ') }}; # Do not advertise nginx version number server_tokens off;