From db61e24d4e0a52bd3e4750de86eaae695bfbd850 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Sat, 22 Jul 2017 15:12:47 +0200 Subject: [PATCH] Change the smartgears nginx virtualhost to be compatible with the new CORS configuration. --- .../templates/generic-smartgears-virtualhost.j2 | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/smartgears/smartgears-nginx-frontend/templates/generic-smartgears-virtualhost.j2 b/smartgears/smartgears-nginx-frontend/templates/generic-smartgears-virtualhost.j2 index b9843c0b..5da25071 100644 --- a/smartgears/smartgears-nginx-frontend/templates/generic-smartgears-virtualhost.j2 +++ b/smartgears/smartgears-nginx-frontend/templates/generic-smartgears-virtualhost.j2 @@ -65,8 +65,10 @@ server { location /{{ context }} { {% if smartgears_nginx_cors_enabled %} include /etc/nginx/snippets/nginx-cors.conf; - {% endif %} + proxy_pass http://localhost:{{ item.http_port }}; + {% else %} proxy_pass http://localhost:{{ item.http_port }}/{{ context }}; + {% endif %} } {% endif %} {% endif %} @@ -101,9 +103,6 @@ server { {% else %} location / { - {% if smartgears_nginx_cors_enabled %} - include /etc/nginx/snippets/nginx-cors.conf; - {% endif %} return 301 https://{{ item.servername }}$request_uri; } {% endif %} @@ -178,8 +177,10 @@ server { location /{{ context }} { {% if smartgears_nginx_cors_enabled %} include /etc/nginx/snippets/nginx-cors.conf; - {% endif %} + proxy_pass http://localhost:{{ item.http_port }}; + {% else %} proxy_pass http://localhost:{{ item.http_port }}/{{ context }}; + {% endif %} } {% endif %} {% endif %}