admin管理员组文章数量:1200423
I'm experiencing an issue with headers in AWS Application Load Balancer (ALB). While the headers are correctly set for successful responses (2XX), they're missing for error responses (4XX, 5XX), causing CORS issues in my frontend application.
Current Header Configuration
I have configured the following custom headers in my ALB: setting the correct headers policy for my ALB
HTTP Strict Transport Security (HSTS): max-age=31536000; includeSubdomains; preload Access-Control-Allow-Origin: * Access-Control-Allow-Headers: * Access-Control-Allow-Methods: HEAD, GET, POST, OPTIONS, DELETE, CONNECT, PUT, PATCH, TRACE Access-Control-Allow-Credentials: true Access-Control-Max-Age: 36000 X-Content-Type-Options: nosniff X-Frame-Options: DENY
Expected Behavior
Headers should be present in ALL responses, regardless of the HTTP status code Frontend should be able to handle error responses properly
Actual Behavior
Headers are only present in 2XX responses Headers are missing in non-2XX responses (4XX, 5XX) Frontend fails to process error responses due to CORS restrictions
Enviroment AWS Application Load Balancer Region: us-east-1
Any help or guidance would be greatly appreciated!
Question
- Why are Headers only appearing in 2XX responses? How can I configure the ALB to include CORS headers in all responses, including error responses or is it an error with that new feature?
2XX response:
expected headers
Non 2xx response:
Headers went response different to 200
本文标签:
版权声明:本文标题:amazon web services - AWS Application Load Balancer (ALB) - Attributes headers missing on non-2XX responses - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738615305a2102874.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论