Move locations out of the proxy conditional.
This commit is contained in:
parent
c070cba810
commit
5bc066b137
templates
|
@ -61,6 +61,7 @@ server {
|
||||||
{% else %}
|
{% 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 %};";
|
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 %}
|
||||||
|
{% endif %}
|
||||||
server_tokens {{ item.server_tokens | default('off') }};
|
server_tokens {{ item.server_tokens | default('off') }};
|
||||||
|
|
||||||
{% if item.ssl_enabled and item.ssl_only %}
|
{% if item.ssl_enabled and item.ssl_only %}
|
||||||
|
@ -132,7 +133,6 @@ server {
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if item.proxy_standard_setup is defined and item.proxy_standard_setup %}
|
{% if item.proxy_standard_setup is defined and item.proxy_standard_setup %}
|
||||||
|
|
||||||
# Proxy stuff
|
# Proxy stuff
|
||||||
{% if item.include_global_proxy_conf is defined and not item.include_global_proxy_conf %}
|
{% if item.include_global_proxy_conf is defined and not item.include_global_proxy_conf %}
|
||||||
{% else %}
|
{% else %}
|
||||||
|
@ -144,6 +144,7 @@ server {
|
||||||
{{ popt }};
|
{{ popt }};
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% if item.locations is defined %}
|
{% if item.locations is defined %}
|
||||||
{% for location in item.locations -%}
|
{% for location in item.locations -%}
|
||||||
|
@ -153,13 +154,13 @@ server {
|
||||||
{% if nginx_cors_enabled %}
|
{% if nginx_cors_enabled %}
|
||||||
{% if not nginx_cors_global %}
|
{% if not nginx_cors_global %}
|
||||||
{% if location.cors is defined and location.cors %}
|
{% 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 %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if location.target is defined %}
|
{% if location.target is defined %}
|
||||||
proxy_pass {{ location.target }};
|
proxy_pass {{ location.target }};
|
||||||
{% elif location.php_target is defined %}
|
{% elif location.php_target is defined %}
|
||||||
try_files $uri =404;
|
try_files $uri =404;
|
||||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||||
|
@ -194,7 +195,6 @@ server {
|
||||||
}
|
}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if item.extra_parameters is defined %}
|
{% if item.extra_parameters is defined %}
|
||||||
{{ item.extra_parameters }}
|
{{ item.extra_parameters }}
|
||||||
|
@ -282,6 +282,7 @@ server {
|
||||||
{% else %}
|
{% 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 %};";
|
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 %}
|
||||||
|
{% endif %}
|
||||||
server_tokens {{ item.server_tokens | default('off') }};
|
server_tokens {{ item.server_tokens | default('off') }};
|
||||||
|
|
||||||
{% if nginx_cors_enabled %}
|
{% if nginx_cors_enabled %}
|
||||||
|
@ -325,6 +326,7 @@ server {
|
||||||
{{ popt }}
|
{{ popt }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% if item.locations is defined %}
|
{% if item.locations is defined %}
|
||||||
{% for location in item.locations -%}
|
{% for location in item.locations -%}
|
||||||
|
@ -333,13 +335,13 @@ server {
|
||||||
{% if nginx_cors_enabled %}
|
{% if nginx_cors_enabled %}
|
||||||
{% if not nginx_cors_global %}
|
{% if not nginx_cors_global %}
|
||||||
{% if location.cors is defined and location.cors %}
|
{% 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 %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if location.target is defined %}
|
{% if location.target is defined %}
|
||||||
proxy_pass {{ location.target }};
|
proxy_pass {{ location.target }};
|
||||||
{% elif location.php_target is defined %}
|
{% elif location.php_target is defined %}
|
||||||
try_files $uri =404;
|
try_files $uri =404;
|
||||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||||
|
@ -374,7 +376,6 @@ server {
|
||||||
}
|
}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if item.extra_parameters is defined %}
|
{% if item.extra_parameters is defined %}
|
||||||
{{ item.extra_parameters }}
|
{{ item.extra_parameters }}
|
||||||
|
|
Loading…
Reference in New Issue