From a40456ea1cb9d58ae2a8beb444dc265cfccadb6f Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Thu, 23 Nov 2017 17:48:56 +0100 Subject: [PATCH] nginx template: give the possibility to add proxy redirections without including the global proxy configurations. --- nginx/templates/nginx-virthost.j2 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nginx/templates/nginx-virthost.j2 b/nginx/templates/nginx-virthost.j2 index 709a414..5d8ca56 100644 --- a/nginx/templates/nginx-virthost.j2 +++ b/nginx/templates/nginx-virthost.j2 @@ -27,7 +27,6 @@ server { return 301 https://{{ item.server_name }}$request_uri; } {% else %} - # This is the default for nginx on Ubuntu 14.04 root {{ item.root | default('/usr/share/nginx/html/') }}; index {{ item.index | default('index.html index.htm') }}; error_page 500 502 503 504 {{ item.error_page | default('/50x.html') }}; @@ -81,7 +80,10 @@ server { {% endif %} {% if item.proxy_standard_setup is defined and item.proxy_standard_setup %} # Proxy stuff + {% if item.include_global_proxy_conf is defined and not item.include_global_proxy_conf %} + {% else %} include /etc/nginx/snippets/nginx-proxy-params.conf; + {% endif %} {% if item.proxy_additional_options is defined %} {% for popt in item.proxy_additional_options %} {{ popt }}; @@ -171,7 +173,10 @@ server { {% endif %} {% if item.proxy_standard_setup is defined and item.proxy_standard_setup %} # Proxy stuff + {% if item.include_global_proxy_conf is defined and not item.include_global_proxy_conf %} + {% else %} include /etc/nginx/snippets/nginx-proxy-params.conf; + {% endif %} {% if item.proxy_additional_options is defined %} {% for popt in item.proxy_additional_options %} {{ popt }}