Use nginx variable to build CSP
This commit is contained in:
@@ -40,7 +40,10 @@ server {
|
|||||||
# See: https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP
|
# See: https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP
|
||||||
# Enforces https content and restricts JS/CSS to origin
|
# Enforces https content and restricts JS/CSS to origin
|
||||||
# External Javascript (such as cast_sender.js for Chromecast) must be whitelisted.
|
# External Javascript (such as cast_sender.js for Chromecast) must be whitelisted.
|
||||||
add_header Content-Security-Policy "default-src https: data: blob: ; img-src 'self' https://* data: ; style-src 'self' 'unsafe-inline' data:; script-src 'self' 'unsafe-inline' https://www.gstatic.com https://www.youtubse.com blob: data:; worker-src 'self' blob: data:; connect-src 'self' data:; object-src 'none' data:; frame-ancestors 'self' data:; font-src 'self' data:";
|
set $CSP "default-src https: data: blob:";
|
||||||
|
set $CSP "$CSP; img-src 'self' https://* data:";
|
||||||
|
# add_header Content-Security-Policy "default-src https: data: blob: ; img-src 'self' https://* data: ; style-src 'self' 'unsafe-inline' data:; style-src-elem data:; script-src 'self' 'unsafe-inline' https://www.gstatic.com https://www.youtubse.com blob: data:; worker-src 'self' blob: data:; connect-src 'self' data:; object-src 'none' data:; frame-ancestors 'self' data:; font-src 'self' data:";
|
||||||
|
add_header Content-Security-Policy $CSP;
|
||||||
|
|
||||||
location /.well-known/acme-challenge/ {
|
location /.well-known/acme-challenge/ {
|
||||||
root /var/www/certbot;
|
root /var/www/certbot;
|
||||||
|
|||||||
Reference in New Issue
Block a user