• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • Support for BIND DNS has been removed from Plesk for Windows due to security and maintenance risks.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS.

Resolved Unable to change CORS header

JDev17

New Pleskian
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?
 
Nevermind, I had set a header in my nodejs app which was passed on and I forgot to change it. I didn't know headers from a nodejs app will be passed on.
 
Back
Top