• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Question Nginx + Mod_pagespeed

Nicolas Boada

New Pleskian
Hi folks,

I just moved from WHM to Plesk panel everything's running smoothly but I'm trying to add mod_pagespeed to my current configuration and can't get it to work.

I enabled the module using the command "plesk sbin nginx_modules_ctl --enable pagespeed" but when I check on Is mod_pagespeed working? it says "Fail! Mod_Pagespeed is not running on that domain."

I will really appreciate if someone knows how to fix it :).

Attached screenshots of PHP Settings and Apache & Nginx settings.

Server info: CentOS Linux 7.6, Plesk Onyx 17.8.11

Thanks in advance!!
 

Attachments

  • nginx.png
    nginx.png
    461.1 KB · Views: 52
  • php.png
    php.png
    493.5 KB · Views: 39
Last edited:
Hey Nicolas,
Have you activated pagespeed in Additional nginx directives? If not, go to domains -> apache & nginx settings -> Additional nginx directives and add:

pagespeed on;

# Needs to exist and be writable by nginx. Use tmpfs for best performance.
pagespeed FileCachePath /var/cache/ngx_pagespeed_cache;
pagespeed EnableFilters combine_css,combine_javascript,combine_heads,convert_meta_tags,recompress_images;

# 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 ~ "^/pagespeed_static/" { }
location ~ "^/ngx_pagespeed_beacon$" { }

Also, made sure that user "nginx" is the owner of /var/cache/ngx_pagespeed_cache.
Try and let me know if it works.
 
Hey Nicolas,
Have you activated pagespeed in Additional nginx directives? If not, go to domains -> apache & nginx settings -> Additional nginx directives and add:

pagespeed on;

# Needs to exist and be writable by nginx. Use tmpfs for best performance.
pagespeed FileCachePath /var/cache/ngx_pagespeed_cache;
pagespeed EnableFilters combine_css,combine_javascript,combine_heads,convert_meta_tags,recompress_images;

# 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 ~ "^/pagespeed_static/" { }
location ~ "^/ngx_pagespeed_beacon$" { }

Also, made sure that user "nginx" is the owner of /var/cache/ngx_pagespeed_cache.
Try and let me know if it works.
Now is working perfectly, thank you very much Viorel!
 
Hello Nicolas, just a quick question, do you use an additional caching plugin on your website or Just Apache + Nginx with Pagespeed? I'm also looking for an Option to get more performance for my domains

Thx
Sally
 
Hello Nicolas, just a quick question, do you use an additional caching plugin on your website or Just Apache + Nginx with Pagespeed? I'm also looking for an Option to get more performance for my domains

Thx
Sally
Hey Sally,

I'm using nginx (without Apache) + phpfpm 7.2 + memcache + w3 total cache.
After trying mod_pagespeed, a few of my sites started showing some errors so I deactivated it.
 
Hello Nicolas,

thanks for your reply. I use the BPS Pro Security Plugin what creates htaccess rules, and for Caching WP Rocket. I need to keep my config with Apache for mod_rewrite and as reverse Proxy Nginx. mod_pagespeed would not really than be a good choice, when it start to make trouble :)

Don't know, if other Community Members here in the Forum can give some advice how to extend my config to get a bit more performance for my websites.

Thx
Sally
 
Back
Top