Move locations out of the proxy conditional.

This commit is contained in:
Andrea Dell'Amico 2022-05-01 17:23:58 +02:00
parent c070cba810
commit 5bc066b137
Signed by: adellam
GPG Key ID: 147ABE6CEB9E20FF
1 changed files with 8 additions and 7 deletions

View File

@ -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 }}