Mozilla 刚刚发布了一个新工具来检查您的网站配置。observatory.mozilla.org
但是扫描抱怨 Cookies(-10 分):会话 cookie 设置没有安全标志......
不幸的是,在我的 nginx 后面运行的服务只能设置安全标头,如果 SSL 直接在那里终止,而不是当 SSL 在 nginx 上终止时。因此,cookie 上没有设置“安全”标志。
是否可以使用 nginx 以某种方式将“安全”标志附加到 cookie 中?修改位置/路径似乎是可能的。
http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_cookie_domain
http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_cookie_path
我想在我的 nginx 服务器中启用 OCSP 装订。我正在使用
我在这件事上真的没有经验,所以这可能是一个微不足道的问题。
这是我的 nginx 安全配置
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
ssl_dhparam /etc/ssl/private/dhparams_4096.pem;
Run Code Online (Sandbox Code Playgroud)
这是我的站点/服务器安全配置:
add_header Strict-Transport-Security "max-age=31536000; includeSubdomains; preload";
# All files have been generated by Let's encrypt
ssl_certificate /etc/letsencrypt/live/myexample.org/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/myexample.org/privkey.pem;
# Everything below this line was added to enable OCSP stapling
# What is that (generated file) and is that required at all?
ssl_trusted_certificate /etc/letsencrypt/live/myexample.org/chain.pem;
ssl_stapling on;
ssl_stapling_verify on;
resolver 8.8.8.8 8.8.4.4 valid=300s;
resolver_timeout 5s;
Run Code Online (Sandbox Code Playgroud)
我读到这足以启用 OCSP 装订。 …