From 66cf85267dc151d28832f1705f98dcf9ffd35690 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Fri, 18 Nov 2016 10:54:40 +0100 Subject: [PATCH] library/roles/smartgears/smartgears-nginx-frontend/templates/generic-smartgears-virtualhost.j2: Do not set 'servername' on the EGI images. The hostname is usually wrong. --- .../templates/generic-smartgears-virtualhost.j2 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/smartgears/smartgears-nginx-frontend/templates/generic-smartgears-virtualhost.j2 b/smartgears/smartgears-nginx-frontend/templates/generic-smartgears-virtualhost.j2 index d7d1d5d..a659e5f 100644 --- a/smartgears/smartgears-nginx-frontend/templates/generic-smartgears-virtualhost.j2 +++ b/smartgears/smartgears-nginx-frontend/templates/generic-smartgears-virtualhost.j2 @@ -1,6 +1,10 @@ server { listen {{ http_port }}; +{% if egi_image is defined and egi_image %} + # No servername into the EGI images +{% else %} server_name {{ item.servername }}; +{% endif %} {% if letsencrypt_acme_install %} include /etc/nginx/snippets/letsencrypt-proxy.conf; {% endif %} @@ -80,7 +84,11 @@ server { {% if letsencrypt_acme_install %} server { listen {{ https_port }} ssl; +{% if egi_image is defined and egi_image %} + # No servername into the EGI images +{% else %} server_name {{ item.servername }}; +{% endif %} access_log /var/log/nginx/{{ item.servername }}_access_ssl.log; error_log /var/log/nginx/{{ item.servername }}_error_ssl.log;