incubator-pagespeed-ngx
incubator-pagespeed-ngx copied to clipboard
Preserve URLs options doesn't exist
These parameters always false: pagespeed ImagePreserveURLs true; pagespeed CssPreserveURLs true; pagespeed JsPreserveURLs true;
I'm checked sources and got that these options exist in Apache version of PageSpeed but not in Nginx version.
What version of PageSpeed do you have installed in nginx?
On Mon, Dec 9, 2019 at 8:33 AM observer.name [email protected] wrote:
These parameters always false: pagespeed ImagePreserveURLs true; pagespeed CssPreserveURLs true; pagespeed JsPreserveURLs true;
I'm checked sources and got that these options exist in Apache version of PageSpeed but not in Nginx version.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/apache/incubator-pagespeed-ngx/issues/1671?email_source=notifications&email_token=AAO2IPKHEANNVZNUJRV6OMLQXZCI3A5CNFSM4JYJHTE2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4H7COO4Q, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAO2IPLHZPBDR4RFWKMTJM3QXZCI3ANCNFSM4JYJHTEQ .
What version of PageSpeed do you have installed in nginx?
X-Page-Speed: 1.13.35.2-0
To clarify: are you saying that you attempted to use those options in ngx_pagespeed, and startup failed saying those options don't exist?
Or did the startup work, but the behavior was not expected?
Or did you just look at the nginx-specific part of the code where you didn't see those options listed by name?
Startup isn't failed but in /?PageSpeedFilters=+debug these options always false.
I did turn off parameters that can overwrite this (resize_images, resize_rendered_image_dimensions, inline_images).
if (options->image_preserve_urls() &&
!options->Enabled(RewriteOptions::kResizeImages) &&
!options->Enabled(RewriteOptions::kResizeToRenderedImageDimensions) &&
!options->Enabled(RewriteOptions::kInlineImages)) {
slot->set_preserve_urls(true);
}
But no result. Next I tried to disable all the filters and change RewriteLevel to OptimizeForBandwidth, but no result - Preserves still False.
In the code, I don't see any Preserve options in Nginx version. Don't know, maybe it includes some Apache files while compiling ngx module but I don't see it working on my server.
Yeah the code structure is not ideal due to the history of how the apache and nginx versions were developed. mod_pagespeed repo includes all the core functionality needed for all server types, and the nginx repo contains only the nginx-specific gasket.
I am pretty sure preserve-URLs works fine in nginx and there must be something about your vhost/config structure that's overriding them.

Something here can override it? Just turned whole config off;
can you share the whole config?
Ok, here's the whole config. All the parameters I turned off in test is turned on; [config.zip]
Hi @ObserverMichael
Maybe not related but you have this;
pagespeed Disallow wildcard_spec;
in optimize.conf.
In nginx config files how these files are included? I see that optimize.conf includes filters.conf, but admin and main? Can you share a url to test?
Hi @ObserverMichael Maybe not related but you have this;
pagespeed Disallow wildcard_spec;in optimize.conf.In nginx config files how these files are included? I see that optimize.conf includes filters.conf, but admin and main? Can you share a url to test?
I disabled that in the test above, no result.
I will say that wilcard_spec is literal in the config file, they must be a regex expresion like * or /name*....
I will say that wilcard_spec is literal in the config file, they must be a regex expresion like * or /name*....
Yeah I know, I will remove that in production. Thanks for the advice.
Hi @ObserverMichael Can you post the configuration page of the admin? https://www.modpagespeed.com/doc/admin
can you share the whole config?
So, any mistakes in the config that able to override PreserveURLs?