Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Mehdi_m's avatar

how to use google nginx pagespeed module for Optimize CSS Delivery in laravel 5.4 on forge

I am using laravel 5.4 running on forge. all the Nginx setting have been done automatically by forge. now I want to optimize my web pages automatically using the google ngx_pagespeed which needs Nginx to be completely rebuild from the start and reinstall it using the below url steps:

https://www.modpagespeed.com/doc/build_ngx_pagespeed_from_source

it said that this code should be run in ssh to implement ngx_pagespeed :

bash <(curl -f -L -sS https://ngxpagespeed.com/install) --nginx-version latest

now my question is that how should I rebuild the nginx on "forge" to keep the forge default configurations. have any one done this proccess to help me how to do? and which other ways exists instead if this way is not good? I have done all css and javascrip minification, compresion, versioning, browser caching ,... and just render-blocking css and javascript and image optimization problem is unsolved. this is my website: https://www.itutorialist.com

0 likes
3 replies
scottzirkel's avatar

I've been trying to get it working, but so far, all I've gotten are either errors or a successful install that still doesn't have the pagespeed module. I feel like I'm missing something. Not sure if it's related to the servers being on Forge or not.

ste's avatar

Anyone having any luck with this? Looking to do similar, but could do with a little guidance.

MohammadAbusaleh's avatar

I'm interested in this too, I can't seem to get it working, and when I got it to work the website didn't load, it kept giving the nginx welcome page.

Please or to participate in this conversation.