I was able to successfully add ngx_pagespeed to my Nginx server at Digital Ocean. I did an automated install per this: https://www.modpagespeed.com/doc/build_ngx_pagespeed_from_source
The module works - for example I can see it is automatically converting my .jpg images to .webp. Also, curl -I -p http://localhost| grep X-Page-Speed
returns the X-Page-Speed: 1.13.35.2-0
header.
However, I’m not able to edit any options. When I try to run something like pagespeed rewrite_images on
, or even pagespeed on
, I get an error pagespeed: command not found
.
Per documentation pagespeed
should be the command for Nginx: https://modpagespeed.com/doc/configuration
I tried a couple of other commands:
whereis pagespeed
returns pagespeed:
which pagespeed
returns nothing.As far as I know these should be returning the full path, something like /usr/bin/pagespeed
Problem was that for some reason I thought pagespeed flags were turned on/off via terminal commands. This assumption is wrong. It actually needs to be done as Nginx directives, added to nginx.conf file and restart the Nginx server.