Hi
Setting the CORS header is a major headache. Most of the time, nothing happens, two headers will be applied or the wrong header will be applied.
I have set a CORS header for nginx (example.com and example2.com for privacy reasons):
add_header 'Access-Control-Allow-Origin' 'https://example.com';
Then I moved / renamed my domain from example.com to example2.com and had to change the header again:
add_header 'Access-Control-Allow-Origin' 'https://example2.com';
After changing the header, nothing changed at all.
I get an error that the header is set to example.com but my domain is example2.com.
I have struggled a lot getting CORS to work before. Even setting the example.com header took me like 1h with server reboots, setting the header and removing it, setting apache headers and removing them, restarting the nginx service and much more until it suddenly worked.
I don't know if this is relevant but I am setting the header for a subdomain of example.com / example2.com
Any Idea what's causing this or am I doing something wrong?
Setting the CORS header is a major headache. Most of the time, nothing happens, two headers will be applied or the wrong header will be applied.
I have set a CORS header for nginx (example.com and example2.com for privacy reasons):
add_header 'Access-Control-Allow-Origin' 'https://example.com';
Then I moved / renamed my domain from example.com to example2.com and had to change the header again:
add_header 'Access-Control-Allow-Origin' 'https://example2.com';
After changing the header, nothing changed at all.
I get an error that the header is set to example.com but my domain is example2.com.
I have struggled a lot getting CORS to work before. Even setting the example.com header took me like 1h with server reboots, setting the header and removing it, setting apache headers and removing them, restarting the nginx service and much more until it suddenly worked.
I don't know if this is relevant but I am setting the header for a subdomain of example.com / example2.com
Any Idea what's causing this or am I doing something wrong?