Wiki / Security headers

Risk: Strict-Transport-Security (HSTS)header not set

The site works over HTTPS but does not tell browsers to always use it, so the first request of each visit can be intercepted on a shared network. It is not an emergency: one line and 10 minutes fix it.

What it does not mean. It does not mean the site has no HTTPS or a bad certificate. Those are checked in separate lines of the report.

Aleksandr IzmalkovFacts checked:

In our report
Risk (red), category weight 1.0 of 2.0
Time to fix
10 minutes if every subdomain already runs on HTTPS
Can it break things
Yes: subdomains without HTTPS stop opening

How to fix it

First make sure HTTP redirects to HTTPS: a browser must ignore this header when it arrives over an unencrypted connection. Start with max-age=300 (5 minutes), test the site and its subdomains, then raise it to a year.

nginx (tested on 1.26.3)

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

Goes into the server block that listens on 443. Without always the header is missing on error pages (404, 500). If a location has its own add_header, the server-level headers no longer apply there: repeat the line.

Apache (tested on 2.4.59, also works in .htaccess)

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

Needs mod_headers. With Header set and no always, the header is missing on 404 and other error responses.

Cloudflare

SSL/TLS → Edge Certificates → HTTP Strict Transport Security (HSTS) → Enable HSTS

Settings: Max Age Header (1 to 12 months), Apply HSTS policy to subdomains, Preload. If the origin server already sends the header, keep one source only.

How to check

curl -sI https://example.com | grep -i strict-transport-security

Expected

strict-transport-security: max-age=31536000; includeSubDomains

An empty result means the header is missing. Repeat with an address that does not exist (for example /missing) to confirm the header is sent on error pages too.

Terminal: curl shows the strict-transport-security response header of aguard.lt with max-age and includeSubDomains
The real response of aguard.lt on 18 November 2026: the header is present on the home page and on a 404 page. Below, a test nginx without always: the 404 response has no header.

What can break

  • With includeSubDomains the browser refuses any subdomain without HTTPS: an old intranet., mail. or a printer interface. Go through the DNS zone before you turn it on.
  • If HTTPS is switched off before max-age runs out, visitors who have already been to the site cannot open it until the period ends. The browser offers no way past the warning.
  • A header sent only over HTTP does nothing: the browser ignores it (RFC 6797, section 8.1).

Possible values

ValueWhat it doesWhen to choose it
max-age=300The browser remembers the rule for 5 minutesTesting on day one
max-age=31536000Remembers it for a yearThe permanent value; the minimum the preload list accepts
includeSubDomainsThe rule covers every subdomain tooWhen every subdomain has a valid certificate
preloadAllows the domain into the list built into browsersOnly if HTTPS stays forever: removal takes months to reach users
max-age=0Tells the browser to forget the ruleWhen you need to switch HSTS off

Our data

8.33%

of 73,386 inspected .lt websites (6,111) send HSTS without includeSubDomains, which leaves their subdomains unprotected. The dataset does not count sites with no header at all. Dataset, 16 November 2026

Sources

Next