I want to add CORS headers to my nginx responses in ddev.
I have added a "cors.conf" in ".ddev/nginx", which is definitely included, since the web container crashes when the configuration file is broken. I have tried different versions, with location
, if
-conditions and so on, but there was no difference - except for a broken state of the configuration file. In this case I got an error from the web container.
cors.conf (right now)
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Methods *;
add_header Access-Control-Allow-Headers *;
add_header Access-Control-Allow-Credentials *;
I expected the headers to show up on every request, but they don't.
Can someone provide a working nginx configuration for ddev with CORS headers?
Edit:
Some system information: * Windows 8.1 * Docker-Toolbox with Docker 18.09.0 * ddev 1.8.0