Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

不明原因的CSP未定义问题 #21

Open
46EULER opened this issue Jun 23, 2020 · 0 comments
Open

不明原因的CSP未定义问题 #21

46EULER opened this issue Jun 23, 2020 · 0 comments

Comments

@46EULER
Copy link

46EULER commented Jun 23, 2020

复杂网络环境下(nginx+V2RAY桥接到树莓派localhost,页面使用nginx反代),默认配置会出现不明原因的浏览器忽略CSP默认参数问题。
需要在nginx的server{}中配置添加CSP头:
`server {
add_header Content-Security-Policy "default-src 'self' https://.googleapis.com/ 'unsafe-eval' 'unsafe-inline';script-src 'self' https://.googleapis.com/ 'unsafe-eval' 'unsafe-inline';img-src 'self';font-src 'self' https://fonts.gstatic.com/;";
#other locations
location / {
#此部分需要根据实际情况自行修改
}

}
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant