I was able to successfully add ngx_pagespeed to my Nginx server. It works - for example I can see it is automatically converting my .jpg images to .webp.
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
Any tips?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hello, @geochanto
What happens when you call the command with the full path? You can first check where is the binary file by using:
whereis pagespeed
or
which pagespeed
and then call the pagespeed with the full path, it should be in /usr/bin/pagespeed
Let me know how it goes.
@ageorgiev I’m not getting the expected result.
For whereis pagespeed: pagespeed:
For which pagespeed, : no response at all
What should I do? I know it does work because if I run curl -I -p http://localhost| grep X-Page-Speed, I get the expected header in the response: X-Page-Speed: 1.13.35.2-0
It is worth mentioning that digitalocean’s tutorial did not work for me. There were errors when I was running sudo dpkg-buildpackage -b, it was failing on signing the buildfile.
Instead I did an automated install per this: https://www.modpagespeed.com/doc/build_ngx_pagespeed_from_source
Problem was that for some reason I thought pagespeed flags were turned on/off via terminal commands.
It actually needs to be done as Nginx directives, added to nginx.conf file and restart the Nginx server afterwards. Everything works.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.