-
Notifications
You must be signed in to change notification settings - Fork 361
Issue with HTTPS only page and noscript support and beacon are injected as http. #1755
Comments
Are these lines all the pagespeed config? pagespeed FetchHttps enable; |
Yes, they are. I have this in nginx.conf
|
And you have a DNS server i 127.0.0.1? |
You are correct 127.0.0.1 is auth dns server for domain that is used and it also resolved all other querys. |
Sorry for commig too late, but have personal issues that make me out of internet for some time. The site runs in https, so why have you: pagespeed MapRewriteDomain "https://redacted" "http://redacted"; MapRewriteDomain makes any ocurrence of http://redacted is rewrited as https://redacted, but if the site runs w/o any proxy, ssl end point or similar thing, why you have http resources in an https page? The error you have posted say this:
So pagespeed is searching for a http resource. |
Thanks for replay, better than newer.
|
The problem seems that pagespeed don't see the https version . Generally spoken having 2 version (http and https) of the same site is a bad idea. Search engines (google ammong others) may consider these pages are duplicate conted. server { |
Yes, I do have 301 redirection from http version to https.
also if https:// starts with www, its get redirected to https://non-www version:
Still the issue is present. Imo with or without http version pagespeed should try to optimize the protocol that it was given. not the one he detects (or not) because any non-https traffic is 301 onto https thats why its a secret to my why he does anything on http. |
I comment out every MapRewriteDomain and LoadFromFile.
reloaded, yet still pagespeed try to parse http content even when every http request is redirected to https, I have no idea why.. maybe its bug in printing log ? |
Can you try adding ?PageSpeedFilters=+debug to the request? https://redacted/someàge/?PageSpeedFilters=+debug (NOTE: PageSpeedFilters is case sensitive, must be as you see here) |
Welcome, once again im struggling with this issue, I didn't resolve it but now its even more anoying as I changed server, upgraded nginx, installed the latest and greatest pagespeed module, but still the issue is there. Different machine, different OS, different software version same issue. I will be trying to resolve the issue this time and I will be posting updates with results here.
As I changed OS (to RHEL compatible) i added sslcert file, without any difference. I tried adding If I add Edit: |
Configuration from Admin Page
page with debug parameter:
And nginx log contains those:
|
After commenting out
Notice the http in there ^, also the nginx log got those warrnings:
|
A question... How the resources are wruten in the html code? Also why this?: (Note 1 image have http and others have https)
|
I know ! And have no clue why pagespeed does that ! Also now its also included:
As you see it reads main domain/page as http:// even when there is no explicid configuration for http version (there is currently only one page configured on this server which is mydomain.com on port 443 with ssl enabled) |
Can you try: For my wordpress instances I use the plugin "SSL Insecure Content Fixer", it rewrites all output links to https. The problem might be somewhere in your mysql database but installing this plugin should fix this easier. |
I found that images added to slider are added like this |
Should I remove old one? because I added yours next to old one, and no difference. @Lofesa I replace scr to image to absolut path with |
I installed |
PageSpeed console still show:
nginx log:
And I don't think that And this results in unable to load those JS files and console throw 404: Edit: |
disabling Currently I have no idea why pagespeed trying so hard to optimize http content when page is https |
What do you see in the logs files about this with debug enabled? in the <!--Summary computation status for CriticalCssBeacon the message says: Cannot create resource: either its domain is unauthorized and InlineUnauthorizedResources is not enabled, or it cannot be fetched (check the server logs) In other hand, have you tried some like this |
smartslider is excluded from pagespeed because of the compatibility issues, I have done it via:
|
One thing that comes to mind, I had the same problem once. I assume you are using php-fpm with fastcgi. I remember vaguely that I had to explicitly force https, in the nginx vhost, |
A bunch of things here.
Not needed, because pahespeed mudules does nothing with these files.
Those with "ver=" are not needed because they are covered with ".js"; and ".css"; Deom the docs: "Note: Wildcards include * which matches any 0 or more characters, and ?, which matches exactly one character. Unlike Unix shells, the / directory separator is not special, and can be matched by either * or ?. The resources are always expanded into their absolute form before expanding. Note: The wildcard will be matched against the full URL including any query parameters. For example, if you want to match URL http://example.com/index.jsp?test=xyz you could use" And take care with the order of these directives, order matter "The later directives take priority over the earlier ones" |
replacing |
I'm trying to make it not work with minimal setup;
Console say: Also I added
|
Currently I have the biggest luck while adding I still have no clue why pagespeed inssist to use http |
In the last config you posted:
Both at the same time, don¡t know what is the result. In the config directives you have
But in the error logs there is
Seems to be from another server config. |
Nah they are the same, I just redacted that name out for my reasones sorry.
Yes I can change that, let me read about it |
I comment out Still the issue even with almost everything comment out is that its fetching or thinking that it fetch The only thing that I have on mind is that pagespeed does work in that way (but I would assume you guys or another user would just say
|
No, is not the way pagespeed work. 1.- pagespeed domain is set wrong. If you don't specify the protocol, by default pagespeed tries the http version only. But here 2 reasons are, aparently , set in the rigth way. Maybe the fastcgi cache? |
I'm using this:
I disabled memcache for pagespeed and fastcgi_cache for page; still issue is there; Also I disabled (removed) memcached caching from wordpress - no luck also; Results for
Edit: Is this normal ? or should there be only https there ? I wasn't sure if you refer about wrong certificates as for server or fetcher so i checked both:
So it looks like its ok ? |
As soon as I disable Instead of But I still think that there is something wrong with my-setup or ngx_pagespeed; |
I read about Found: Found (as page support gzip): In doc's I found: Edit: As I listed request in developer tools in browser I saw that beacon is still pointing to http version: |
After downgrading pagespeed, trying it on fresh wordpress instalation, the beacon still point's to HTTP version of page when there is non, also the module try to access http://domain:443/ which is illegal. |
My server serve pages via https (http/2) and redirect every http traffic to https.
I had few issues but somehow resolve most of them:
<noscript><meta http-equiv=refresh content="0;url='**http**://redacted/?PageSpeed=noscript'"/>...
that pagespeed included was HTTP instead of HTTPS, that was resolve via disabling adding code and add it manually.pagespeed SupportNoScriptEnabled false;
http
instead ofhttp**s**
. I tried rewriting beacon url but that append to value before/ngx_pagespeed_beacon
and not thehttp://redacted
part.The beacon is hosted correctly and POST is send to correct endpoint but the url that is passed to it is with bad protocol (http instead of https)
https://redacted/ngx_pagespeed_beacon?url=http://redacted/
I have:
sadly if I dont add
LoadFromFile
for http address my site break as it get error in console:# [Warning] [1502319] [image.webp:0] Resource based on http://redacted/wp-content/uploads/2022/07/image.webp but cannot access the original
Also I see a lot http logs on pagespeed_admin console tab and im unsure if its hardcoded or HTTPS is not fully supported.
nginx 1.23
pagespeed 1.14.36.1-0
The text was updated successfully, but these errors were encountered: