From 2c859a7f49b31a802cb7ecccda7fe9b9a0ef341a Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Thu, 20 Jul 2017 13:49:50 +0200 Subject: [PATCH] brary/roles/smartgears/smartgears-nginx-frontend: Optionally expose the gcube logs via http. d4science-ghn-cluster: Expose the gcube logs on the dataminer servers. --- .../smartgears-nginx-frontend/defaults/main.yml | 1 + .../templates/generic-smartgears-virtualhost.j2 | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/smartgears/smartgears-nginx-frontend/defaults/main.yml b/smartgears/smartgears-nginx-frontend/defaults/main.yml index 4f10d081..b69e5630 100644 --- a/smartgears/smartgears-nginx-frontend/defaults/main.yml +++ b/smartgears/smartgears-nginx-frontend/defaults/main.yml @@ -7,3 +7,4 @@ smartgears_install_generic_virthost: True smartgears_nginx_cors_enabled: False nginx_cors_acl_origin: '' data_transfer_service_install: False +smartgears_nginx_expose_tomcat_logs: False diff --git a/smartgears/smartgears-nginx-frontend/templates/generic-smartgears-virtualhost.j2 b/smartgears/smartgears-nginx-frontend/templates/generic-smartgears-virtualhost.j2 index 04be5b9d..5076e47a 100644 --- a/smartgears/smartgears-nginx-frontend/templates/generic-smartgears-virtualhost.j2 +++ b/smartgears/smartgears-nginx-frontend/templates/generic-smartgears-virtualhost.j2 @@ -93,6 +93,15 @@ server { proxy_pass http://localhost:8787/; } {% endif %} + + {% if smartgears_nginx_expose_tomcat_logs %} + location /gcube-logs/ { + alias {{ smartgears_instance_path }}/logs/; + autoindex on; + autoindex_localtime on; + } + {% endif %} + {% else %} location / { {% if smartgears_nginx_cors_enabled %} @@ -198,5 +207,12 @@ server { } {% endif %} + {% if smartgears_nginx_expose_tomcat_logs %} + location /gcube-logs/ { + alias {{ smartgears_instance_path }}/logs; + autoindex on; + autoindex_localtime on; + } + {% endif %} } {% endif %}