Overview
Apache Pagespeed (formerally known as Google mod_pagespeed) is an an extension available to both Apache and NGINX which automatically applies web performance best practices. This includes functions such as CSS minification, image optimisation, deferral of JavaScript loading and more to improve page performance.
For Conetix customers, we can setup and configure this module for NGINX so that you can take advantage of the extended functions. However, as this can cause issues with all websites, the extended functionality remains disabled by default for each website subscription to prevent issues.
Instructions
- Ensure that the Plesk module and required directories has been configured and tested. This should be actioned via a support request to the Conetix team. Plesk have a guide on enabling Apache Pagespeed for NGINX.
- Login to your Plesk Control Panel.
- Select the website to enable, then go to Apache and nginx settings:
- Scroll down to the bottom and under Additional nginx directives add:
pagespeed on;
pagespeed FileCachePath "/var/cache/nginx-pagespeed/<WEBSITE>";
pagespeed RewriteLevel OptimizeForBandwidth;
location ~ "\.pagespeed\.([a-z]\.)?[a-z]{2}\.[^.]{10}\.[^.]+" {
add_header "" "";
}
location ~ "^/pagespeed_static/" { }
location ~ "^/ngx_pagespeed_beacon$" { }
Note: Ensure you update the <WEBSITE> placeholder for your specific site.