• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

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