Hide Access-Control-Allow-Origin before adding it again.
This commit is contained in:
parent
f2d22e9d53
commit
37b9a73821
|
@ -1,8 +1,10 @@
|
|||
{% if nginx_cors_extended_rules %}
|
||||
if ($request_method = 'OPTIONS') {
|
||||
{% if nginx_cors_limit_origin %}
|
||||
proxy_hide_header Access-Control-Allow-Origin;
|
||||
add_header 'Access-Control-Allow-Origin' '{{ nginx_cors_acl_origin | default("$http_origin") }}';
|
||||
{% else %}
|
||||
proxy_hide_header Access-Control-Allow-Origin;
|
||||
add_header 'Access-Control-Allow-Origin' '{{ nginx_access_control_allow_origin_src | default("*") }}';
|
||||
{% endif %}
|
||||
add_header 'Access-Control-Allow-Credentials' 'true';
|
||||
|
@ -21,8 +23,10 @@ if ($request_method = 'OPTIONS') {
|
|||
}
|
||||
if ($request_method = 'POST') {
|
||||
{% if nginx_cors_limit_origin %}
|
||||
proxy_hide_header Access-Control-Allow-Origin;
|
||||
add_header 'Access-Control-Allow-Origin' '{{ nginx_cors_acl_origin | default("$http_origin") }}';
|
||||
{% else %}
|
||||
proxy_hide_header Access-Control-Allow-Origin;
|
||||
add_header 'Access-Control-Allow-Origin' '{{ nginx_access_control_allow_origin_src | default("*") }}';
|
||||
{% endif %}
|
||||
add_header 'Access-Control-Allow-Credentials' 'true';
|
||||
|
@ -32,8 +36,10 @@ if ($request_method = 'POST') {
|
|||
}
|
||||
if ($request_method = 'GET') {
|
||||
{% if nginx_cors_limit_origin %}
|
||||
proxy_hide_header Access-Control-Allow-Origin;
|
||||
add_header 'Access-Control-Allow-Origin' '{{ nginx_cors_acl_origin | default("$http_origin") }}';
|
||||
{% else %}
|
||||
proxy_hide_header Access-Control-Allow-Origin;
|
||||
add_header 'Access-Control-Allow-Origin' '{{ nginx_access_control_allow_origin_src | default("*") }}';
|
||||
{% endif %}
|
||||
add_header 'Access-Control-Allow-Credentials' 'true';
|
||||
|
@ -43,8 +49,10 @@ if ($request_method = 'GET') {
|
|||
}
|
||||
{% else %}
|
||||
{% if nginx_cors_limit_origin %}
|
||||
proxy_hide_header Access-Control-Allow-Origin;
|
||||
add_header 'Access-Control-Allow-Origin' '{{ nginx_cors_acl_origin | default("$http_origin") }}';
|
||||
{% else %}
|
||||
proxy_hide_header Access-Control-Allow-Origin;
|
||||
add_header 'Access-Control-Allow-Origin' '{{ nginx_access_control_allow_origin_src | default("*") }}';
|
||||
{% endif %}
|
||||
if ($request_method = OPTIONS ) {
|
||||
|
|
Loading…
Reference in New Issue