NGINX allow CORS

Started by _tribal_, October 18, 2024, 11:44:12 PM

Previous topic - Next topic
October 18, 2024, 11:44:12 PM Last Edit: October 19, 2024, 12:23:00 AM by _tribal_
How to allow CORS when using NGINX ?
I've placed:
    add_header 'Access-Control-Allow-Origin' 'https://xyz.test.top' always;
    add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
    add_header 'Access-Control-Allow-Headers' 'Origin, Content-Type, Accept, Authorization' always;
    add_header 'Access-Control-Allow-Credentials' 'true' always;


directly into the nginx.conf file but it doesn't seem to work. Maybe I'm doing it wrong, in this case I'd like to know how to do it right?


Oh, thanks, and I was wondering where to create the catalog.