You are not logged in.

#1 2020-11-17 22:58:08

icouto
Member
Registered: 2020-11-12
Posts: 6

Pagespeed (ngx_pagespeed) not rewriting images

I have installed `nginx-mod-pagespeed`, with the main goal being to get it to convert a site's images automatically to WebP.

I configured it according to the official instructions. I can see that Pagespeed is on, but no matter what I try, it won't rewrite the images. Here is what I have already checked:

  • Checked that the module is ON, by checking that the response headers for the html page include an X-Page-Speed header.

  • Checked that the cache folders are writable by user 'http' - they are, and I can see that Pagespeed is indeed creating sub-folders, and adding stuff there without problems

  • Explicitly added directives to turn on image rewriting:

    pagespeed RewriteLevel CoreFilters; 
    pagespeed EnableFilters rewrite_images;
  • As the site is being served via HTTPS (HTTP/2), added a LoadFromFile directive, to fetch images directly from the 'media' folder. Just to be safe, in case it might still be trying to fetch via https, I also added an SslCertDirectory directive pointing to '/etc/ssl/certs'.

  • As nginx is serving the images itself directly, there is NO 'nocache'/'private' header being issued by a backend.

  • Made sure there is NO nginx caching - i.e., no 'fastcgi_cache', no 'proxy_cache', etc.

I've enabled the 'Pagespeed Admin pages', and when I check the "Message History", I see several entries like this:

No permission to rewrite 'https://example.com/media/pages/photography/ocean/the-beach-1024x1024.jpg'
No permission to rewrite 'https://example.com/media/pages/photography/sky/blood-moon-1024x1024.jpg'
...
Could not rewrite resource in-place because URL is not in cache: http://example.com/media/pages/photography/ocean/the-beach-1024x1024.jpg
Could not rewrite resource in-place because URL is not in cache: http://example.com/media/pages/photography/sky/blood-moon-1024x1024.jpg

I feel like there must be something obvious I've missed, but I've run out of things to try - and I've reached the point where googling is not giving me anything new.

Any suggestions would be incredibly welcome.

Last edited by icouto (2020-11-17 23:05:48)

Offline

Board footer

Powered by FluxBB