你好,
我想修改 Strict-Transport-Security 标头。我在 app.yml 中使用了以下代码:
run:
# nginx modifications
- replace:
filename: "/etc/nginx/conf.d/discourse.conf"
from: /add_header Strict-Transport-Security.+/
to: "add_header Strict-Transport-Security 'max-age=31536000; includeSubdomains; preload';"
这可以处理第一次出现的情况:
add_header Strict-Transport-Security 'max-age=63072000';
但还有另一个出现的情况是:
location @discourse {
add_header Strict-Transport-Security 'max-age=31536000'; # remember the certificate for a year and automatically connect to HTTPS for this domain
我是否做错了什么?为什么 Strict-Transport-Security 标头的第二次出现没有被修改?