1. Home
  2. Glossary
  3. HSTS
Security

HSTS (Strict-Transport-Security)

An HTTP response header that tells browsers to use only HTTPS for your domain for a set number of seconds, even if a visitor types an http:// address.

Why it matters

It stops a visitor being sent over plain HTTP on repeat visits, which closes a window for downgrade attacks. Only enable it once HTTPS works on every part of the site.

Example

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

Where you will see it

The free Security headers checker looks at this on a live page and explains what it finds in plain English: grade HSTS, CSP and the other protective headers, with copy-paste fixes for Nginx, Apache, Cloudflare and Netlify.

Related terms

  • TLS: Transport Layer Security, the protocol that encrypts the connection between browser and server.
  • Mixed content: An HTTPS page that loads some resources, such as images, scripts or styles, over plain HTTP. Browsers may block these or show a warning.
  • HTTP header: A name and value pair sent along with a request or a response.

Go deeper

  • Security headers explained: What HSTS, Content-Security-Policy, X-Content-Type-Options, frame-ancestors, Referrer-Policy and Permissions-Policy do, with safe example values.

← All 66 glossary terms

↑ ↓ to moveEnter to openEsc to closeAll results