azurewordpress-pro

Use PageSpeed with NGINX

To enable PageSpeed, add the configuration below within the server block of the /opt/bitnami/nginx/conf/bitnami/bitnami.conf file:

pagespeed on;
pagespeed FileCachePath /opt/bitnami/nginx/var/ngx_pagespeed_cache;
location ~ "\.pagespeed\.([a-z]\.)?[a-z]{2}\.[^.]{10}\.[^.]+" { add_header "" ""; }
location ~ "^/ngx_pagespeed_static/" { }
location ~ "^/ngx_pagespeed_beacon$" { }

Restart the NGINX server for your changes to take effect.

$ sudo /opt/bitnami/ctlscript.sh restart nginx
Last modification April 18, 2019