nginx with add_header ‘Access-Control-Allow-Origin’ ‘*’ but still request blocked with CORS
I have built up a prototype system.
Error : Failed to Fetch. Only on Mobile Web
Im running EC2 ubuntu server.
NGINX does not add ‘Access-Control-Allow-Origin’ ‘mydomain’ always header
as described above I have the following nginx header-config:
Backend sends access-control-allow-origin: ‘https://localhost:4000’ but there is error in dev console that it is set to *
In devtools I see that backend is sending header:
Can’t determine the source of a CORS error
I have an Angular app whose build I am trying to run on an nginx docker container accessible at http://localhost:4001/
. All 4001
resources load correctly, but the javascript bundle makes an xhr request to https:localhost:5001/foo/bar
(note port and scheme change) that is blocked by firefox (“CORS failed”): a dotnet core app hosted in another docker container.