Your software
My PHP version is : 7.2.32
My MySQL/MariaDB version is (delete as applicable): MySQL 8
My Webserver is: NGinx
Updating/Installing Errors
I am (delete as applicable): Installing
Upgrading/installing via (delete as applicable) : Web
These errors are showing in the installer :
N/A
These errors are showing in the Mautic log :
N/A
These errors are showing in the upgrade_log.txt file (located in the root of your Mautic instance when an upgrade has been attempted - ensure you remove or redact any sensitive data such as domain names in the file path) :
N/A
Your problem
My problem is :
When trying to implement CORS, I get the following error in the Javascript console of the webpage that calls the tracking script:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://<MY MAUTIC SERVER>/mtc/event. (Reason: Multiple CORS header āAccess-Control-Allow-Originā not allowed).
In my NGinx config I have the following:
add_header 'Access-Control-Allow-Headers' 'Authorization,Content-Type,Accept,Origin,User-Agent,DNT,Cache-Control,X-Mx-ReqToken,Keep-Alive,X-Requested-With,If-Modified-Since';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Origin' $http_origin;
add_header 'Access-Control-Allow-Credentials' "true";
In Mautic, Iāve got āRestrict Domainsā set to YES, and Iāve listed all of the calling domains in āValid Domainsā text field, however no matter what I change the NGINX headers or Mautic Settings to, I get the same errors.
The only thing Iāve not done is change the tracking code after each change to the server - does Mautic recreate the tracking code based on the value of āRestricted Domainsā?