Use PageSpeed with NGINX
IMPORTANT: PageSpeed is not supported on Windows native installers.
Enable PageSpeed
To enable PageSpeed, add the configuration below within the server block of the installdir/nginx/conf/bitnami/bitnami.conf file:
pagespeed on;
pagespeed FileCachePath installdir/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 installdir/ctlscript.sh restart nginx
Disable PageSpeed
To disable PageSpeed, follow these steps:
-
Comment out the following lines within the server block of the installdir/nginx/conf/bitnami/bitnami.conf file, as shown:
# pagespeed on; # pagespeed FileCachePath installdir/nginx/var/ngx_pagespeed_cache;
-
Restart NGINX:
$ sudo installdir/ctlscript.sh restart nginx