Fix the nginx template for the uri-resolver. See https://support.d4science.org/issues/12768

This commit is contained in:
Andrea Dell'Amico 2018-10-24 19:23:39 +02:00
parent 3d7387d06c
commit 6fed3715e1
1 changed files with 16 additions and 3 deletions

View File

@ -67,6 +67,7 @@ server {
{% for instance in tomcat_m_instances %}
{% for context in instance.app_contexts %}
{% if context != "whn-manager" %}
{% if context != "uri-resolver" %}
{% if context != '' %}
location /{{ context }} {
{% if varnish_install is defined and varnish_install %}
@ -95,6 +96,7 @@ server {
}
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
{% endfor %}
{% if smart_executor_install is defined and smart_executor_install %}
@ -157,7 +159,10 @@ server {
{% if smartgears_nginx_cors_enabled %}
include /etc/nginx/snippets/nginx-cors.conf;
{% endif %}
proxy_pass http://127.0.0.1:{{ smartgears_http_port }}/uri-resolver/;
rewrite ^ $request_uri;
rewrite ^/(.*) uri-resolver/$1 break;
return 400; #if the second rewrite won't match
proxy_pass http://127.0.0.1:{{ smartgears_http_port }}/$uri;
}
{% endif %}
@ -238,6 +243,7 @@ server {
{% for instance in tomcat_m_instances %}
{% for context in instance.app_contexts %}
{% if context != "whn-manager" %}
{% if context != "uri-resolver" %}
{% if context != '' %}
location /{{ context }} {
{% if varnish_install is defined and varnish_install %}
@ -266,6 +272,7 @@ server {
}
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
{% endfor %}
{% if smart_executor_install is defined and smart_executor_install %}
@ -320,14 +327,20 @@ server {
allow {{ ip }};
{% endfor %}
deny all;
proxy_pass http://127.0.0.1:{{ smartgears_http_port }}/uri-resolver/geonetwork;
rewrite ^ $request_uri;
rewrite ^/(.*) uri-resolver/$1 break;
return 400; #if the second rewrite won't match
proxy_pass http://127.0.0.1:{{ smartgears_http_port }}/$uri;
}
location / {
{% if smartgears_nginx_cors_enabled %}
include /etc/nginx/snippets/nginx-cors.conf;
{% endif %}
proxy_pass http://127.0.0.1:{{ smartgears_http_port }}/uri-resolver/;
rewrite ^ $request_uri;
rewrite ^/(.*) uri-resolver/$1 break;
return 400; #if the second rewrite won't match
proxy_pass http://127.0.0.1:{{ smartgears_http_port }}/$uri;
}
{% endif %}