在 Nginx 的 server 块中添加 Strict-Transport-Security 'max-age=31536000; includeSubDomains' always 后,发现响应头中同时出现了 Strict-Transport-Security 'max-age=0'Strict-Transport-Security 'max-age=31536000; includeSubDomains' always。这可能是由于其他配置导致出现 Strict-Transport-Security 'max-age=0',例如在 Tomcat 中也设置了 Strict-Transport-Security 头部信息,但没有设置 max-age 值,导致默认值为 0。

建议检查 Tomcat 中的配置,确保没有设置重复的头部信息。

Nginx 添加 Strict-Transport-Security 头部后出现 max-age=0 问题

原文地址: https://www.cveoy.top/t/topic/oibJ 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录