cancel
Showing results for 
Search instead for 
Did you mean: 

Using CDN breaks Magento

SOLVED

Using CDN breaks Magento

Hi there,

I need help using Magento 2.3.5p1 with a CDN. My server is hosted by cloudways and they offering a CDN Service too. It gets applied automatically with one single click.

 

Once I switch to CDN and the links to the static and media files are set the admin and frontend are not working correctly. In the admin the popup notifications are not shown, the sales and product grids are not loaded.

 

On the frontend every popup and even the product swatches are not displayed. the additional information tabs are all under each other. The cart does not show any estimated shipping costs etc.

 

This can be found:

Access to XMLHttpRequest at '/pub/static/frontend/Mgs/molla/de_DE/Magento_Ui/templates/modal/modal-popup.html' from origin 'domain.com’ has been blocked by CORS policy: Request header field x-requested-with is not allowed by Access-Control-Allow-Headers in preflight response.

 

I also installed Splashlabs Cors requests, but its still not working.
https://github.com/splashlab/magento-2-cors-requests

 

Can anybody help me out how to fix this?

 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Using CDN breaks Magento

Hello @MadisonCooper ,

 

This is because of domain difference in CDN, you can try the below solution :

 

https://community.magento.com/t5/Installing-Magento-2-x/CORS-policy-No-Access-Control-Allow-Origin-h...

Problem Solved ? Click on 'Kudos' & Accept as Solution ! Smiley Happy

View solution in original post

1 REPLY 1

Re: Using CDN breaks Magento

Hello @MadisonCooper ,

 

This is because of domain difference in CDN, you can try the below solution :

 

https://community.magento.com/t5/Installing-Magento-2-x/CORS-policy-No-Access-Control-Allow-Origin-h...

Problem Solved ? Click on 'Kudos' & Accept as Solution ! Smiley Happy