【发布时间】:2020-10-13 12:27:31
【问题描述】:
我正在向我的网站添加安全标头。我正在运行 Nginx 服务器。
我已使用“内容安全策略 (CSP) 生成器”chrome 扩展来创建我的 CSP 设置。
添加到 nginx ssl.conf 中的 CSP 语句为:
add_header Content-Security-Policy "default-src 'self';
script-src 'report-sample' 'self' https://maps.googleapis.com/.../util.js;
style-src 'report-sample' 'self' https://code.jquery.com https://fonts.googleapis.com;
object-src 'none';
base-uri 'self';
connect-src 'self';
font-src 'self' https://fonts.gstatic.com;
frame-src 'self';
img-src 'self' data: https://code.jquery.com https://maps.gstatic.com;
manifest-src 'self';
media-src 'self';
report-uri https://???.endpoint.csper.io/;
worker-src 'none';";
这些设置似乎只能在 Firefox 中使用。
当我在 Chrome (v77.01) 中加载网站时,网站不会加载。它在 Edge(版本 83.0.478.54)、Safari 和 Opera 中显示相同的结果。
我看到以下信息:
无法访问此站点 https:domain.com 上的网页可能暂时关闭,或者它可能已永久移至新网址。 ERR_HTTP2_PROTOCOL_ERROR
SSL 证书是 Lets Encrypt,将于 2020 年 9 月到期。
任何建议将不胜感激。
干杯
格雷格·J
【问题讨论】:
标签: google-chrome http-headers