Not copmress images, no webp transofrm

184 views
Skip to first unread message

Петя Пробкин

unread,
Feb 1, 2018, 4:41:32 AM2/1/18
to mod-pagespeed-discuss
Hi, guys!

I install ngx_pagespeed module, check on in nginx.conf, but not all images on my site compress and transform to webp.
What I'm doing wrong?

My site: https://sochi-elite.com/https://sochi-elite.com/
ngx_pagespeed module: 1.12.34.3-0
nginx 1.12.2


nginx.conf:
user bitrix;
worker_processes
8;
error_log
/var/log/nginx/error.log warn;
pid
/var/run/nginx.pid;
worker_rlimit_nofile
10240;


events
{
       
use epoll;
        worker_connections  
10240;
}

http
{
        pagespeed on
;
        pagespeed
FileCachePath "/var/cache/ngx_pagespeed/";
        pagespeed
RewriteLevel CoreFilters;



Otto van der Schaaf

unread,
Feb 1, 2018, 5:10:55 AM2/1/18
to mod-pagesp...@googlegroups.com
Can you try adding the following?:

pagespeed EnableFilters convert_png_to_webp;



--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-di...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mod-pagespeed-discuss/15c25387-d7a7-4c62-9bbd-d7eb7adbca45%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Петя Пробкин

unread,
Feb 1, 2018, 6:57:05 AM2/1/18
to mod-pagespeed-discuss
Yes, I do it and get whis test fail:

nginx: [warn] [ngx_pagespeed 1.12.34.2-0] [0201/145401:WARNING:google_message_handler.cc(56)] Invalid filter name: convert_png_to_webp
nginx
: [emerg] "pagespeed" directive "EnableFilters convert_png_to_webp" Failed to enable some filters. in /etc/nginx/nginx.conf:16
nginx
: configuration file /etc/nginx/nginx.conf test failed





четверг, 1 февраля 2018 г., 14:10:55 UTC+4 пользователь Otto van der Schaaf написал:

Otto van der Schaaf

unread,
Feb 1, 2018, 9:29:04 AM2/1/18
to mod-pagesp...@googlegroups.com
Sorry, my bad.  
You can enable the debug filter by adding "?PageSpeedFilters=+debug" to the url. 
That shows messages like:

I looks like somehow the module is not able to fetch any image resources in /upload.
Can you relate that to something specific in nginx.conf ?

Otto


--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-di...@googlegroups.com.

Joshua Marantz

unread,
Feb 1, 2018, 9:34:38 AM2/1/18
to mod-pagespeed-discuss
And also, I think Otto meant convert_jpeg_to_webp, not convert_png_to_webp.  See https://www.modpagespeed.com/doc/reference-image-optimize for the complete list of options.

Note that if you enable convert_png_to_jpeg and convert_jpeg_to_webp, you'll enable direct lossless conversion of png to webp, where jpeg is not an intermediary.

Fun with options :)


Using ?PageSpeedFilters=+debug is a great way to see why any of this is failing (usually due to fetcher setup problems).



On Thu, Feb 1, 2018 at 9:28 AM, Otto van der Schaaf <osc...@we-amp.com> wrote:
Sorry, my bad.  
You can enable the debug filter by adding "?PageSpeedFilters=+debug" to the url. 
That shows messages like:

I looks like somehow the module is not able to fetch any image resources in /upload.
Can you relate that to something specific in nginx.conf ?

Otto

On Thu, Feb 1, 2018 at 12:57 PM Петя Пробкин <denis...@gmail.com> wrote:
Yes, I do it and get whis test fail:

nginx: [warn] [ngx_pagespeed 1.12.34.2-0] [0201/145401:WARNING:google_message_handler.cc(56)] Invalid filter name: convert_png_to_webp
nginx
: [emerg] "pagespeed" directive "EnableFilters convert_png_to_webp" Failed to enable some filters. in /etc/nginx/nginx.conf:16
nginx
: configuration file /etc/nginx/nginx.conf test failed





четверг, 1 февраля 2018 г., 14:10:55 UTC+4 пользователь Otto van der Schaaf написал:
Can you try adding the following?:

pagespeed EnableFilters convert_png_to_webp;

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mod-pagespeed-discuss/CAHqmWiPFFDGNQT6u%2BSrqYHpd8SXcDdA%3DdNyrcRh_XdHuKYFXDw%40mail.gmail.com.

Петя Пробкин

unread,
Feb 2, 2018, 7:44:05 AM2/2/18
to mod-pagespeed-discuss

Thank you very much!

"?PageSpeedFilters=+debug"  is realy great!

Петя Пробкин

unread,
Feb 12, 2018, 3:02:08 AM2/12/18
to mod-pagespeed-discuss
Well, I still have <!--4xx status code ... --> on my site. I tried all methods, but this error don't gone. Config files in attach.
What can I do else?

http://joxi.ru/D2PGBgvTdPvJXm
bitrix.conf
ssl.s1.conf
nginx.conf

Otto van der Schaaf

unread,
Feb 12, 2018, 8:12:22 AM2/12/18
to mod-pagesp...@googlegroups.com
Sometimes the module runs into a problem while fetching via https because some
additional configuration is needed:

You could look into that, or set up the module to load static files directly from disk:

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-di...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mod-pagespeed-discuss/d3c4e2f5-0dfc-49da-b975-e293e2b56748%40googlegroups.com.

Longinos

unread,
Feb 12, 2018, 8:31:06 AM2/12/18
to mod-pagespeed-discuss
Can you try to add
pagespeed Domain http*://*.sochi-elite.com;

and change the protocol agnostic /resource in the resources url to an absolute path https://sochi-elite.com/resource ?

Петя Пробкин

unread,
Feb 13, 2018, 9:10:40 AM2/13/18
to mod-pagespeed-discuss
I added both options at the end, but still have 4xx error.
My actual config:

http {
        pagespeed on
;
        pagespeed
FileCachePath "/var/cache/ngx_pagespeed/";

       
#pagespeed RewriteLevel CoreFilters;
        pagespeed
EnableFilters convert_jpeg_to_webp,convert_to_webp_animated;
        pagespeed
MapOriginDomain "https://localhost" "https://sochi-elite.com";
        pagespeed
FetchHttps enable,allow_self_signed,allow_unknown_certificate_authority,allow_certificate_not_yet_valid;
        pagespeed
SslCertDirectory /etc/letsencrypt/live/sochi-elite.com;
        pagespeed
SslCertFile /etc/letsencrypt/live/sochi-elite.com/cert.pem;

        pagespeed
CriticalImagesBeaconEnabled false;
       
#pagespeed PreserveUrlRelativity on;
        pagespeed
JpegRecompressionQuality 85;
        pagespeed
ImageRecompressionQuality 85;
       
#pagespeed ImageInlineMaxBytes 2048;
       
#pagespeed LowercaseHtmlNames on;
        pagespeed
FileCacheSizeKb 204800;
        pagespeed
FileCacheCleanIntervalMs 600000;
        pagespeed
FileCacheInodeLimit 500000;
        pagespeed
DisableFilters add_head;
        pagespeed
Domain http*://*.sochi-elite.com;
        pagespeed
LoadFromFile "https://sochi-elite.com/upload/" "/home/bitrix/www/upload/";


Longinos

unread,
Feb 14, 2018, 2:47:14 AM2/14/18
to mod-pagespeed-discuss
But have you tried to use absolute url´s other than relatives?
Change it on only some url and try if these url´s don´t throw the 404 error.
In other hand I can´t see the location for optimized rsources as stated in doc
# 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$" { }



El jueves, 1 de febrero de 2018, 10:41:32 (UTC+1), Петя Пробкин escribió:
Reply all
Reply to author
Forward
0 new messages