Lighthouse audit is-on-https · Best Practices

Does not use HTTPS: what it means and how to fix it

View raw .md for LLMs / your notes
Quick answer: This audit fails when the page is served over HTTP or loads insecure mixed content. Fix it by installing a free TLS certificate, 301-redirecting all HTTP to HTTPS at the server or CDN edge, upgrading insecure subresource URLs to https, and adding a strong HSTS header.

Lighthouse fails this audit when the page is served over plain HTTP, or over HTTPS but loading some resources insecurely (mixed content). HTTPS is a baseline requirement for security, SEO, and access to modern browser APIs.

TL;DR

What does the HTTPS audit check?

Two things: that the main document is served over HTTPS, and that it does not request active mixed content (scripts, stylesheets, iframes) over HTTP. Passive mixed content (images) may warn rather than fail but should still be fixed.

Why does HTTPS matter?

How do I migrate to HTTPS?

1. Install a TLS certificate

Almost every host and CDN issues free, auto-renewing certificates:

2. Redirect all HTTP to HTTPS

Do this at the server or CDN edge, never in JavaScript (JS runs too late to protect the request).

nginx:

server {
  listen 80;
  server_name example.com www.example.com;
  return 301 https://example.com$request_uri;
}

Apache (.htaccess):

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

3. Fix mixed content

Find and upgrade insecure subresources:

<!-- Before -->
<script src="http://cdn.example.com/widget.js"></script>
<!-- After -->
<script src="https://cdn.example.com/widget.js"></script>

As a safety net, add:

<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests" />

4. Add HSTS

Tell browsers to always use HTTPS for your domain:

Strict-Transport-Security: max-age=31536000; includeSubDomains; preload

Only add preload once you are confident every subdomain is HTTPS, as it is hard to reverse.

What are common HTTPS mistakes?

How do I verify HTTPS?

  1. Re-run Lighthouse: the audit should pass.
  2. Load the site over http://: it must 301 to https://.
  3. DevTools → Console: no mixed-content warnings; padlock shows secure.
  4. Check the Strict-Transport-Security response header is present.
  5. Confirm canonical, sitemap, and internal links all use https://.

Related audits


Audit your URL at https://lighthouse-md.com.

Audit your page now

Paste your URL, get scores plus a CLAUDE.md plan for Claude Code.

Run audit →