Added `always` property to sent headers also on http errors returned (e.g. 4xx or 5xx). See #28488#note-21

This commit is contained in:
Francesco Mangiacrapa 2024-12-17 12:20:56 +01:00
parent c47961f9dc
commit 57cfa7ea06
2 changed files with 4 additions and 4 deletions

View File

@ -91,7 +91,7 @@ nginx_client_body_timeout: 240s
nginx_cors_enabled: false
nginx_cors_global: true
nginx_cors_limit_origin: true
nginx_cors_limit_origin: false
nginx_cors_extended_rules: false
nginx_cors_acl_origin: 'http?://(localhost)'
nginx_access_control_allow_origin_src: "*"

View File

@ -61,8 +61,8 @@ if ($request_method = OPTIONS ) {
{% if nginx_cors_limit_origin %}
add_header 'Access-Control-Allow-Credentials' 'true';
{% endif %}
add_header 'Access-Control-Allow-Methods' '{{ nginx_cors_allowed_methods }}';
add_header 'Access-Control-Allow-Headers' '{{ nginx_cors_allowed_headers }}';
add_header 'Access-Control-Expose-Headers' '{{ nginx_cors_allowed_headers }}';
add_header 'Access-Control-Allow-Methods' '{{ nginx_cors_allowed_methods }}' always;
add_header 'Access-Control-Allow-Headers' '{{ nginx_cors_allowed_headers }}' always;
add_header 'Access-Control-Expose-Headers' '{{ nginx_cors_allowed_headers }}' always;
{% endif %}