• 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 PLESK NGINX compiled with Pagespeed

Dukemaster

Regular Pleskian
THANKS PLESK ! ! !
Since todays update 17.8.11 Update #43 Plesk's Nginx is compiled with Pagespeed.

I tried the configuration of the days I used ngx_pagespeed with a self compiled version of Nginx, but it doesn't work now.
Settings in nginx.conf
pagespeed on;
pagespeed FileCachePath /var/ngx_pagespeed_cache;

and also pagespeed related settings in Apache & nginx settings of subscription
Code:
nginx: [emerg] unknown directive "pagespeed" in /etc/nginx/nginx.conf:54
nginx: configuration file /etc/nginx/nginx.conf test failed

Would be nice if Plesk Support or Plesk Forum could provide an instruction or little help how to use Pagespeed.
 
Last edited:
Enable module first with:

# plesk sbin nginx_modules_ctl -e pagespeed

then check that it is enabled:

# plesk sbin nginx_modules_ctl -s
pagespeed on
 
WOOOW again, after 2017...
IT WORKS....shm_metadata_cache and v3 filled with data

Created:
/var/ngx_pagespeed_cache
chown nginx:nginx /var/ngx_pagespeed_cache;


/etc/nginx/nginx.conf:
Code:
    pagespeed on;
    pagespeed FileCachePath /var/ngx_pagespeed_cache;
    pagespeed FileCacheSizeKb 204800;
    pagespeed FileCacheCleanIntervalMs 3600000;
    pagespeed FileCacheInodeLimit 500000;
    pagespeed LRUCacheKbPerProcess 8192;
    pagespeed LRUCacheByteLimit 16384;
    pagespeed CreateSharedMemoryMetadataCache "/var/ngx_pagespeed_cache/" 51200;

    pagespeed Statistics on;
    pagespeed StatisticsLogging on;
    pagespeed LogDir /var/log/pagespeed;
    pagespeed AdminPath /pagespeed_admin;
    pagespeed GlobalAdminPath /pagespeed_global_admin;
    pagespeed StatisticsPath /ngx_pagespeed_statistics;
    pagespeed GlobalStatisticsPath /ngx_pagespeed_global_statistics;
    pagespeed MessagesPath /ngx_pagespeed_message;
    pagespeed ConsolePath /pagespeed_console;
    pagespeed UsePerVhostStatistics on;
    pagespeed MessageBufferSize 100000;
    pagespeed EnableCachePurge on;

Apache & Nginx Settings Subscription:
Code:
pagespeed On;
location ~ "\.pagespeed\.([a-z]\.)?[a-z]{2}\.[^.]{10}\.[^.]+" {
    add_header "" "";
}
location ~ "^/pagespeed_static/" { }
location ~ "^/ngx_pagespeed_beacon$" { }
pagespeed EnableFilters insert_ga;
pagespeed AnalyticsID <UA-xxxxxx-1>;
pagespeed Statistics on;
pagespeed StatisticsLogging on;
pagespeed LogDir /var/log/pagespeed;
pagespeed AdminPath /pagespeed_admin;
location /ngx_pagespeed_statistics { allow 127.0.0.1; deny all; }
location /ngx_pagespeed_global_statistics { allow 127.0.0.1; deny all; }
location /ngx_pagespeed_message { allow 127.0.0.1; deny all; }
location /pagespeed_console { allow 127.0.0.1; deny all; }
location ~ ^/pagespeed_admin { allow 127.0.0.1; deny all; }
location ~ ^/pagespeed_global_admin { allow 127.0.0.1; deny all; }
 
Last edited:
BTW, it doesn't work with enabled SELinux. Disable it first.

Code:
root@server:~# sestatus | grep "Current mode"

Command 'sestatus' not found, but can be installed with:

apt install policycoreutils

lol...I've never enabled SELinux in 13 years Plesk. :oops:
 
Becarefull activing pagespeed! In mobile device, a lot of web have image problem visualisation and have do disable it to solve problem!!!
 
Becarefull activing pagespeed! In mobile device, a lot of web have image problem visualisation and have do disable it to solve problem!!!
Hmmm... Works perfectly on my personal site with browsing by mobile Chrome...
 
Hmmm... Works perfectly on my personal site with browsing by mobile Chrome...

In the unique webserver that we have test it, with the parameter that is present on this item, almost 2 webs have problem with mobile device, we have disabled it before have more issue with other client...
 
In the unique webserver that we have test it, with the parameter that is present on this item, almost 2 webs have problem with mobile device, we have disabled it before have more issue with other client...
Any technical details of this problem? Logs, errors, steps to reproduce and so on?
 
Any technical details of this problem? Logs, errors, steps to reproduce and so on?
I will try to reproduce the problem on other server with only 1 test site, I can't do it in an production server, I will contact you when I done it to try to review/solve issue.
 
I will try to reproduce the problem on other server with only 1 test site, I can't do it in an production server, I will contact you when I done it to try to review/solve issue.
When ready, please, submit your detailed report right here - Reports
 
In my production environment Plesk's ngx_pagespeed is running like a charm. Running since (only) yesterday I can see the amazing success today.
(Ubuntu 18.04.2, Plesk 17.8.11#43, Webserver configuration Nginx only, PHP 7.3.2 FPM served by nginx, 4 websites are communities by WoltLab software/CMS/Apps)
It is important to adjust the settings exactly on the website. It depends on whether a CMS is used and how the CMS or webseite processes the web pages content.
Herefor it's a good idea to look in this thread where different ways are discussed and solved.

In addition to my configuration in this post I put the following settings in /etc/nginx/nginx.conf, this is exactly tailored to the needs of my web pages.
Code:
    # Needs to exist and be writable by nginx.  Use tmpfs for best performance.
    pagespeed EnableFilters insert_dns_prefetch;
    pagespeed EnableFilters combine_css,combine_javascript;
    pagespeed EnableFilters make_show_ads_async,make_google_analytics_async;
    pagespeed EnableFilters extend_cache,extend_cache_pdfs;
    pagespeed PreserveUrlRelativity on;
    pagespeed EnableFilters inline_google_font_css;
    pagespeed EnableFilters remove_comments,collapse_whitespace;
    pagespeed EnableFilters in_place_optimize_for_browser;

@IgorG Brotli compression would be also important to be compiled with Nginx I didn't find any hints to it.
Now I set pagespeed EnableCachePurge on; to off, because too much people from Internet purged my Cache the last 24 hours....:D
 
Last edited:
How to fix the following error:
[ngx_pagespeed 1.13.35.2-0] PageSpeed Serf fetch failure rate extremely high; only 0 of 23760 recent fetches fully successful; is fetching working?

Thanks!
 
@IgorG I finally test and the problem appear on some web in mobile device, style are lost, responsive image are lost... It's not seem an server error (nothing in logs) but seem that the pagespeed generate problem with js and/or style sometime. I have screenshot of problem web on various device (xiaomi a1 or samsung device, that are updated with chrome), when we disable the pagespeed, automatically, the images are responsive again in these device...
 
@sebgonzes I had this kind of problems also, two years ago. For example avatars which look like eggs, deformation of images, wrong places of images. This is the result by enabling too much/the wrong filters.
Instead the 14 Core filters are safe and they do the best work.

You should not enable the following filters, because they are dangerous in doing more as expected:

rewrite_css,
rewrite_javascript,
move_css_above_scripts,
inline_preview_images,
resize_mobile_images,
rewrite_style_attributes,
move_css_to_head,
insert_image_dimensions;
 
Last edited:
@sebgonzes I had this kind of problems also, two years ago. For example avatars which look like eggs, deformation of images, wrong places of images. This is the result by enabling too much or better, the wrong filters.
Instead the 14 Core filters are safe and they do the best work.

You should not enable the following filters, because they are dangerous in doing more as expected:

rewrite_css,
rewrite_javascript,
move_css_above_scripts,
inline_preview_images,
resize_mobile_images,
rewrite_style_attributes,
move_css_to_head,
insert_image_dimensions;

Oh! great, so I had to add :

pagespeed DisableFilters rewrite_css, rewrite_css, rewrite_javascript, move_css_above_scripts, inline_preview_images, resize_mobile_images, rewrite_style_attributes, move_css_to_head, insert_image_dimensions;

?
 
Please, try the filters from this post in this thread.
I followed here the tipps by UFHH01 in 2017 and they are very successful from the past until present with ngx_pagespeed by PLESK.
 
Please, try the filters from this post in this thread.
I followed here the tipps by UFHH01 in 2017 and they are very successful from the past until present with ngx_pagespeed by PLESK.

But in your post, I only see that you active some filter... it's mean other filter are automatically disabled?
On the actual test, I just active your first line on nginx.conf :


pagespeed on;
pagespeed FileCachePath /var/ngx_pagespeed_cache;
pagespeed FileCacheSizeKb 204800;
pagespeed FileCacheCleanIntervalMs 3600000;
pagespeed FileCacheInodeLimit 500000;
pagespeed LRUCacheKbPerProcess 8192;
pagespeed LRUCacheByteLimit 16384;
pagespeed CreateSharedMemoryMetadataCache "/var/cache/pagespeed/" 51200;

but none of


pagespeed EnableFilters....

with no "EnableFilters" line, all filter are active?

Thanks a lot for your help!
 
No. By the way if you use no filter configuration like in your last post, then nevertheless the CORE filters are enabled, because they are enabled by default. But you can disable specific core filters.
Please read Configuring PageSpeed Filters and here is the whole overview Installing From Packages
I've made the experience with pagespeed filters that less filters are better than more filters!
The very few ones I posted here are enough to speed up communities with forum, webgallery, blogs, calendar, filebase. Amazing faster... and I get 96% in Google Pagespeed Insights for Desktop. 30% more than without ngx_pagespeed.
 
Last edited:
Back
Top