diff --git a/templates/nginx-virthost.j2 b/templates/nginx-virthost.j2 index f03df74..6bc4411 100644 --- a/templates/nginx-virthost.j2 +++ b/templates/nginx-virthost.j2 @@ -61,6 +61,7 @@ server { {% else %} add_header Content-Security-Policy "frame-src{% for s in nginx_content_security_src_acl %} {{ s }}{% endfor %}; frame-ancestors{% for l in nginx_content_security_ancestor_acl %} {{ l }}{% endfor %};"; {% endif %} + {% endif %} server_tokens {{ item.server_tokens | default('off') }}; {% if item.ssl_enabled and item.ssl_only %} @@ -132,7 +133,6 @@ 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 %} @@ -144,6 +144,7 @@ server { {{ popt }}; {% endfor %} {% endif %} + {% endif %} {% if item.locations is defined %} {% for location in item.locations -%} @@ -153,13 +154,13 @@ server { {% if nginx_cors_enabled %} {% if not nginx_cors_global %} {% if location.cors is defined and location.cors %} - include /etc/nginx/snippets/nginx-cors.conf; + include /etc/nginx/snippets/nginx-cors.conf; {% endif %} {% endif %} {% endif %} {% if location.target is defined %} - proxy_pass {{ location.target }}; + proxy_pass {{ location.target }}; {% elif location.php_target is defined %} try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; @@ -194,7 +195,6 @@ server { } {% endfor %} {% endif %} - {% endif %} {% if item.extra_parameters is defined %} {{ item.extra_parameters }} @@ -282,6 +282,7 @@ server { {% else %} add_header Content-Security-Policy "frame-src{% for s in nginx_content_security_src_acl %} {{ s }}{% endfor %}; frame-ancestors{% for l in nginx_content_security_ancestor_acl %} {{ l }}{% endfor %};"; {% endif %} + {% endif %} server_tokens {{ item.server_tokens | default('off') }}; {% if nginx_cors_enabled %} @@ -325,6 +326,7 @@ server { {{ popt }} {% endfor %} {% endif %} + {% endif %} {% if item.locations is defined %} {% for location in item.locations -%} @@ -333,13 +335,13 @@ server { {% if nginx_cors_enabled %} {% if not nginx_cors_global %} {% if location.cors is defined and location.cors %} - include /etc/nginx/snippets/nginx-cors.conf; + include /etc/nginx/snippets/nginx-cors.conf; {% endif %} {% endif %} {% endif %} {% if location.target is defined %} - proxy_pass {{ location.target }}; + proxy_pass {{ location.target }}; {% elif location.php_target is defined %} try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; @@ -374,7 +376,6 @@ server { } {% endfor %} {% endif %} - {% endif %} {% if item.extra_parameters is defined %} {{ item.extra_parameters }}