Skip to content
This repository was archived by the owner on Apr 10, 2025. It is now read-only.
This repository was archived by the owner on Apr 10, 2025. It is now read-only.

Issue with HTTPS only page and noscript support and beacon are injected as http. #1755

@bigretromike

Description

@bigretromike

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:

  1. the <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;
  2. the issue that I have now (I don't know if that's gonna be big issue or not) is that the beacon is added with http instead of http**s**. I tried rewriting beacon url but that append to value before /ngx_pagespeed_beacon and not the http://redacted part.
pagespeed.CriticalImages.Run('/ngx_pagespeed_beacon','http://redacted/','gLvPo-P25G',false,true,'zFnuPmTKJDs');

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:

pagespeed Domain https://redacted;
# pagespeed MapOriginDomain "https://redacted" "http://redacted";  # this one doesn't affect beacon so this one is turn off
pagespeed MapRewriteDomain "https://redacted" "http://redacted"
pagespeed LoadFromFile "https://redacted/wp-content/" "/var/www/wp-content/";
pagespeed LoadFromFile "http://redacted/wp-content/" "/var/www/wp-content/";

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions