[Resolved] Site library images not loading, csp issue

Home Forums Support [Resolved] Site library images not loading, csp issue

Home Forums Support Site library images not loading, csp issue

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1408423
    Surajit

    Hi,
    It would help greatly if you can find the issue here, and probably the mistake I am making.
    On first installation, site library images are not loading. Chrome developer tools show

    themes.php?page=generatepress-site-library:1 Refused to load the image ‘https://gpsites.co/files/dev/screenshot.png’ because it violates the following Content Security Policy directive: “img-src ‘self’ https://*.gpsites.co https://*.jquery.com https://*.w.org https://*.redux.io https://*.wp.com https://*.gravatar.com data:”.

    As far as I understand, I have included the policy https://*.gpsites.co in the img-src directive, as you can see.
    I have cleared redis cache, opcache, cache-enabler and fvm multiple times.
    Reloaded nginx multiple times and also flushed cache through wp cli to no avail.

    Demo sites don’t load and stuck at the same point.

    But I have added the required csp.

    So what more can I do to import demo sites? Where am I going wrong?

    And I have already tried out double ‘refres’ etc and all other visible solutions.

    BTW, I have been able to import the demo site, but developer tools keep giving me warnings about various images missing due to the abovementioned content policy

    #1408559
    David
    Staff
    Customer Support

    Hi there,

    try disabling Redis and any other CDNs, server caches and plugin caches. As they will interfere with the process.

    #1408830
    Surajit

    Strange, when I took out the prefix *. to include subdomains from https://*.gpsites.co and included simple https://gpsites.co in the csp directive, things began working as normal. But is this normal behaviour? Am I missing something that can give me pains in the future?

    #1409155
    David
    Staff
    Customer Support

    As long as your server can reach https://gpsites.co then there should be no issues.
    Generally it is server side caching / CDNs that will cause the problem.

    #1409369
    Surajit

    Thanks a million. Yes caching is usually the first culprit. But in this case what I did not understand is why *.gpsites.co did not resolve to gpsites.co, and where things may be different. Knowing that would have helped in the future from avoiding issues.

    As for this problem, it is solved. Thanks for your time.

    #1410165
    David
    Staff
    Customer Support

    You’re welcome

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.