Change the smartgears nginx virtualhost to be compatible with the new CORS configuration.

This commit is contained in:
Andrea Dell'Amico 2017-07-22 15:12:47 +02:00
parent 032f49040a
commit db61e24d4e
1 changed files with 6 additions and 5 deletions

View File

@ -65,8 +65,10 @@ server {
location /{{ context }} { location /{{ context }} {
{% if smartgears_nginx_cors_enabled %} {% if smartgears_nginx_cors_enabled %}
include /etc/nginx/snippets/nginx-cors.conf; include /etc/nginx/snippets/nginx-cors.conf;
{% endif %} proxy_pass http://localhost:{{ item.http_port }};
{% else %}
proxy_pass http://localhost:{{ item.http_port }}/{{ context }}; proxy_pass http://localhost:{{ item.http_port }}/{{ context }};
{% endif %}
} }
{% endif %} {% endif %}
{% endif %} {% endif %}
@ -101,9 +103,6 @@ server {
{% else %} {% else %}
location / { location / {
{% if smartgears_nginx_cors_enabled %}
include /etc/nginx/snippets/nginx-cors.conf;
{% endif %}
return 301 https://{{ item.servername }}$request_uri; return 301 https://{{ item.servername }}$request_uri;
} }
{% endif %} {% endif %}
@ -178,8 +177,10 @@ server {
location /{{ context }} { location /{{ context }} {
{% if smartgears_nginx_cors_enabled %} {% if smartgears_nginx_cors_enabled %}
include /etc/nginx/snippets/nginx-cors.conf; include /etc/nginx/snippets/nginx-cors.conf;
{% endif %} proxy_pass http://localhost:{{ item.http_port }};
{% else %}
proxy_pass http://localhost:{{ item.http_port }}/{{ context }}; proxy_pass http://localhost:{{ item.http_port }}/{{ context }};
{% endif %}
} }
{% endif %} {% endif %}
{% endif %} {% endif %}