Add a conditional section for the uri-resolver.

This commit is contained in:
Andrea Dell'Amico 2018-10-18 18:05:17 +02:00
parent 47148c448d
commit 5a9fb9328a
1 changed files with 47 additions and 12 deletions

View File

@ -126,6 +126,15 @@ server {
proxy_pass http://{{ remote_opencpu_host }}:{{ opencpu_proxy_port | default('8004') }}{{ opencpu_context | default('/ocpu') }}; proxy_pass http://{{ remote_opencpu_host }}:{{ opencpu_proxy_port | default('8004') }}{{ opencpu_context | default('/ocpu') }};
} }
{% endif %} {% endif %}
{% if smartgears_nginx_expose_tomcat_logs %}
location /gcube-logs/ {
alias {{ smartgears_instance_path }}/logs/;
autoindex on;
autoindex_localtime on;
}
{% endif %}
{% if rstudio_install_server is defined and rstudio_install_server %} {% if rstudio_install_server is defined and rstudio_install_server %}
location / { location / {
{% if smartgears_nginx_cors_enabled %} {% if smartgears_nginx_cors_enabled %}
@ -135,12 +144,20 @@ server {
} }
{% endif %} {% endif %}
{% if smartgears_nginx_expose_tomcat_logs %} {% if smartgears_uri_resolver_install is defined and smartgears_uri_resolver_install %}
location /gcube-logs/ { location /geonetwork {
alias {{ smartgears_instance_path }}/logs/; {% for ip in ckan_ip_list %}
autoindex on; allow {{ ip }};
autoindex_localtime on; {% endfor %}
} deny all;
}
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/;
}
{% endif %} {% endif %}
{% else %} {% else %}
@ -278,6 +295,15 @@ server {
proxy_pass http://{{ remote_opencpu_host }}:{{ opencpu_proxy_port | default('8004') }}{{ opencpu_context | default('/ocpu') }}; proxy_pass http://{{ remote_opencpu_host }}:{{ opencpu_proxy_port | default('8004') }}{{ opencpu_context | default('/ocpu') }};
} }
{% endif %} {% endif %}
{% if smartgears_nginx_expose_tomcat_logs %}
location /gcube-logs/ {
alias {{ smartgears_instance_path }}/logs/;
autoindex on;
autoindex_localtime on;
}
{% endif %}
{% if rstudio_install_server is defined and rstudio_install_server %} {% if rstudio_install_server is defined and rstudio_install_server %}
location / { location / {
{% if smartgears_nginx_cors_enabled %} {% if smartgears_nginx_cors_enabled %}
@ -287,12 +313,21 @@ server {
} }
{% endif %} {% endif %}
{% if smartgears_nginx_expose_tomcat_logs %} {% if smartgears_uri_resolver_install is defined and smartgears_uri_resolver_install %}
location /gcube-logs/ { location /geonetwork {
alias {{ smartgears_instance_path }}/logs/; {% for ip in ckan_ip_list %}
autoindex on; allow {{ ip }};
autoindex_localtime on; {% endfor %}
} deny all;
}
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/;
}
{% endif %} {% endif %}
} }
{% endif %} {% endif %}