Plesk

Unable to start nginx on Plesk server: [emerg] unknown directive “pagespeed”

Symptoms

The following error occurs on an attempt to create a subscription or restart nginx:

ERR [util_exec] proc_close() failed ['/usr/local/psa/admin/bin/nginx_control' '--start'] with exit code [1] Can not start proxy server: /usr/local/psa/admin/sbin/nginx-config execution failed: nginx: [emerg] unknown directive "pagespeed" in /etc/nginx/nginx.conf:53 nginx: configuration file /etc/nginx/nginx.conf test failed

Cause

nginx provided with Plesk is not compiled with the pagespeed nginx module.

Resolution

It is required to remove pagespeed directives from the nginx configuration file.

To speed up the web server, it is recommended to use Google PageSpeed Insights for Apache or nginx gzip compression.

  1. Connect to the server via SSH

  2. Use any text editor to remove or comment out all the pagespeed directives from /etc/nginx/nginx.conf

  3. Check that nginx configuration file is fine with the following command:

    # nginx -t
    nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
    nginx: configuration file /etc/nginx/nginx.conf test is successful

  4. Re-create configuration files for all domains with the following command:

    # plesk sbin httpdmng --reconfigure-all

    Warning: Reconfiguration implies downtime, which depends on the number of domains