Assuming the following, what domain will be HSTS'ed for the next year, foo.com or bar.com? RTFM (RFC6797) doesn't help much.

> GET / HTTP/1.1
> Host: foo.com
[ ... ]
< HTTP/1.1 301 Moved Permanently
< Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
< Location: https://bar.com
  • Technically it depends on the header sent when contacting second website (bad obfuscation, you should have used the .example TLD instead): maybe the second website also use HSTS with the same headers. But in general MAximillian answer holds: the header protects the ongoing HTTP exchange so applies to the website you are connecting too, whatever happens after the connection (error, serving local page, proxying, redirecting, etc.) Dec 17, 2018 at 19:06

1 Answer 1


The HSTS will apply to foo.com. HSTS always applies to the server serving the response itself.

If you think about it, if it worked the other way then people could set HSTS on each other's sites, which would be a big mess.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.