大网数据广告活动
服务器运维问答

HSTS exclude specific subdomain with "includeSubdomains"

· 52CE 我爱测

I'm using HSTS with this header on my website: Strict-Transport-Security: max-age=15768000; includeSubDomains This works as intended and forces the browser to redirect all http connections to https. In the documentation at https:…

问题原文

原帖链接 · zuim · CC BY-SA 3.0

I'm using HSTS with this header on my website:

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

This works as intended and forces the browser to redirect all http connections to https.

In the documentation at https://www.rfc-editor.org/rfc/rfc6797#section-6.1.2 I did not find a way to exclude specified subdomains!

I already tried to add max-age=0 for the subdomain, but it does not overwrite includeSubDomains

Is it possible to exclude subdomains from the includeSubDomains rule? Or is the only way to remove this rule and just use the HSTS header for some websites? PS: My webserver is NGINX and I tested the behaviour with firefox and chrome.

已采纳解答

原帖链接 · EoghanM · CC BY-SA 3.0

No:

I think one of the points of includeSubdomains is to ensure that it's not possible for an attacker to hijack cookies etc. by forcing end user to load a subdomain over plain http and then them. If there was even one exception to includeSubdomains then it would be useless (assuming it's possible for the attacker to figure out what the exception is).

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-04-20)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。