Fork me on GitHub

Nginx 解决内容安全策略CSP(Content-Security-Policy)配置方式(漏洞修复)

Nginx 解决内容安全策略CSP(Content-Security-Policy)配置方式


 

 

1、修改 nginx 配置文件

在nginx.conf 配置文件中,增加如下配置内容:

add_header Content-Security-Policy "default-src 'self' localhost:8080 'unsafe-inline' 'unsafe-eval' blob: data: ;";

 

效果如下:

 

 

2、重启 nginx 服务

systemctl restart nginx

或者

service nginx restart

 

posted @ 2021-01-13 20:41  龙凌云端  阅读(19587)  评论(0编辑  收藏  举报