From dd97e5ec7958fe77b4c7bd6eb58412ddf1f2f84a Mon Sep 17 00:00:00 2001 From: Emilien Mantel Date: Fri, 22 Jan 2016 09:46:43 +0100 Subject: [PATCH] Apps vhosts should without root and created dirs --- tasks/vhost.yml | 4 ++-- templates/etc/nginx/sites-available/_backuppc.j2 | 2 +- templates/etc/nginx/sites-available/_proxy.j2 | 1 + vars/main.yml | 4 ++++ 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/tasks/vhost.yml b/tasks/vhost.yml index ee18cee..cfe72fd 100644 --- a/tasks/vhost.yml +++ b/tasks/vhost.yml @@ -23,7 +23,7 @@ with_items: nginx_vhosts when: > item.root is not defined and - (item.template is defined and item.template != '_proxy') and + (item.template is defined and item.template not in nginx_templates_no_dir) and (item.delete is not defined or not item.delete) and item.redirect_to is not defined @@ -37,7 +37,7 @@ with_items: nginx_vhosts when: > item.root is not defined and - (item.template is defined and item.template != '_proxy') and + (item.template is defined and item.template not in nginx_templates_no_dir) and (item.delete is not defined or not item.delete) and item.redirect_to is not defined diff --git a/templates/etc/nginx/sites-available/_backuppc.j2 b/templates/etc/nginx/sites-available/_backuppc.j2 index 5caf3f1..6bcb999 100644 --- a/templates/etc/nginx/sites-available/_backuppc.j2 +++ b/templates/etc/nginx/sites-available/_backuppc.j2 @@ -13,7 +13,7 @@ {% block template_local_content %} location ~ /\.ht { - deny all; + deny all; } location /backuppc/image { diff --git a/templates/etc/nginx/sites-available/_proxy.j2 b/templates/etc/nginx/sites-available/_proxy.j2 index cec327e..248fed5 100644 --- a/templates/etc/nginx/sites-available/_proxy.j2 +++ b/templates/etc/nginx/sites-available/_proxy.j2 @@ -4,6 +4,7 @@ {% if item.root is defined %} root {{ item.root }}; {% endif %} +{% endblock %} {% block template_try_files %} include /etc/nginx/proxy_params; diff --git a/vars/main.yml b/vars/main.yml index 2b0f475..6c89185 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -27,3 +27,7 @@ nginx_dirs: - "{{ nginx_ssl_dir }}" - "{{ nginx_helper_dir }}" +nginx_templates_no_dir: + - '_proxy' + - '_nagios3' + - '_backuppc'