/etc/nginx-sp/vhosts.d/APPNAME.d/pagespeed.conf
with the following content (replace APPNAME with the name of your app)
pagespeed on; pagespeed FileCachePath /var/cache/pagespeed; # Ensure requests for pagespeed optimized resources go to the pagespeed # handler and no extraneous headers get set. location ~ "\.pagespeed\.([a-z]\.)?[a-z]{2}\.[^.]{10}\.[^.]+" { add_header "" ""; } location ~ "^/ngx_pagespeed_static/" { } location ~ "^/ngx_pagespeed_beacon$" { } location /ngx_pagespeed_statistics { deny all; } location /ngx_pagespeed_global_statistics { deny all; } location /ngx_pagespeed_message { deny all; } location /pagespeed_console { deny all; }
Then, restart Nginx by running the following command as root:
sudo service nginx-sp restart
You can verify PageSpeed is enabled by looking for the X-Page-Speed response header:
curl -s -I http://YOUR_DOMAIN/ | grep X-Page-Speed
bash <(curl -f -L -sS https://ngxpagespeed.com/install) \ --nginx-version latest
./configure: error: the HTTP rewrite module requires the PCRE library.
You can either disable the module by using --without-http_rewrite_module
option, or install the PCRE library into the system, or build the PCRE library
statically from the source with nginx by using --with-pcre=<path> option.
Error: Failure running './configure --add-module=/root/ngx_pagespeed-latest-stable', exiting
I am not very good with server stuff. Any suggestions?
--
You received this message because you are subscribed to the Google Groups "ngx-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ngx-pagespeed-di...@googlegroups.com.
Visit this group at https://groups.google.com/group/ngx-pagespeed-discuss.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to ngx-pagespeed-discuss+unsub...@googlegroups.com.