Fail

HSTS isn't set

The short version

Send Strict-Transport-Security: max-age=31536000; includeSubDomains over HTTPS.

What it means

Your site answers over HTTPS, but the response has no Strict-Transport-Security (HSTS) header. Browsers therefore keep trying plain HTTP first whenever someone types your name or follows an old link.

Why it matters

That first plain HTTP request can be intercepted before your redirect to HTTPS takes effect, so an attacker on public Wi-Fi can keep the visitor on a fake plain HTTP copy of your site. HSTS tells browsers to go straight to HTTPS for a set time, and to refuse to continue past certificate errors.

How to fix it

  1. Make sure every page and every subdomain you include works over HTTPS.
  2. Start with a short time to test: Strict-Transport-Security: max-age=300.
  3. Raise it to a year once nothing breaks: max-age=31536000; includeSubDomains.
  4. Send it on HTTPS responses only; browsers ignore it over plain HTTP.

Nginx

add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;

Apache

Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains"

Check it worked

Run the HTTP and security headers check again. The Strict-Transport-Security row should show your value, and the finding should be gone.