• Resolved onilink00

    (@onilink00)


    Hello,
    I have a problem with a website where I use W3 Total Cache.
    I have some json animations that fail to load when the plugin is active.
    When checking the javascript console, I see these errors:

    Access to XMLHttpRequest at ‘…’ (redirected from ‘…’) from origin ‘…’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

    I’m using a CDN to provide the content.
    What can I do to fix it?
    Thank you

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @onilink00

    Thank you for reaching out and I am happy to assist you with this.
    Yes, I can see the issue and the error in your console.
    I can see that other files do have access-control-allow-origin: * header.
    Can you please add to following rule outside of W3TC rules in your nginx.conf:

    location ~* \.(eot|ttf|woff|woff2|json|js|css)$ {
        add_header Access-Control-Allow-Origin *;
    }

    Reload your website and let me know if this helps!
    THanks!

Viewing 1 replies (of 1 total)
  • The topic ‘Problem with json files and CORS policy’ is closed to new replies.