Added always property to send headers even on response with http errors (e.g. 4xx or 5xx) #1

Merged
adellam merged 1 commits from new_cors_configs into master 2024-12-17 15:52:26 +01:00
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 %}