For the docker/sdk their is an option to set CORS:...
# docker
b
For the docker/sdk their is an option to set CORS:
Copy code
fastcgi_param SPRYKER_GLUE_APPLICATION_CORS_ALLOW_ORIGIN '*';
But when i have an external frontend for example in a Azure CDN i get the following message: No 'Access-Control-Allow-Origin' header is present on the requested resource.
h
Please add the following in
config/Shared/config_default-docker.php
Copy code
$config[GlueApplicationConstants::GLUE_APPLICATION_CORS_ALLOW_ORIGIN] = getenv('SPRYKER_GLUE_APPLICATION_CORS_ALLOW_ORIGIN') ?: '';
b
I already add this line in the docker conf, but the error still exists.
h
Can you check manually in response headers?
But anyway I would prefer to setup CORS on proxy level, not on app level.
b
Ok i will check the headers, but I totally agree with you to set the CORS on proxy level
Ok so i remove the SPRYKER_GLUE_APPLICATION_CORS_ALLOW_ORIGIN and set the header in the nginx with
Copy code
add_header 'Access-Control-Allow-Origin' '*';
Now im getting the following error, is there any "magic" in spryker were the application is trying to set this header?
Copy code
The 'Access-Control-Allow-Origin' header contains multiple values ', *', but only one is allowed.
s
should be
Copy code
set_header 'Access-Control-Allow-Origin' '*';
b
unfortunately there is no set_header option for nginx
s
ah crap indeed it was about proxy, my bad
b
no problem, i didn't get it, when i follow the idea from @high-pencil-62400 i get multiple values, so i decide to role all configs back and remove the SPRYKER_GLUE_APPLICATION_CORS_ALLOW_ORIGIN from the code, now im getting this:
Copy code
The 'Access-Control-Allow-Origin' header has a value '<http://glue.de.suite.local>' that is not equal to the supplied origin.
For now, i think i remove all rhe origins modification from our config or code and spryker still get some from wherever