prepare to introduce nonce support for
This commit is contained in:
@@ -1,10 +1,19 @@
|
||||
set_secure_random_alphanum $cspNonce 32;
|
||||
# usage
|
||||
#<script nonce="**CSP_NONCE**">
|
||||
#
|
||||
# sub filter to ensure that the CSP NONCE is introduce
|
||||
|
||||
add_header Content-Security-Policy "default-src 'none'; img-src 'self'; \
|
||||
script-src 'self'; style-src 'self' 'unsafe-inline'; \
|
||||
script-src 'self' 'nonce-$cspNonce'; style-src 'self' 'unsafe-inline'; \
|
||||
font-src 'self'; base-uri 'self'; form-action 'self';\
|
||||
connect-src 'self'; frame-ancestors 'none'";
|
||||
add_header X-Content-Type-Options nosniff;
|
||||
add_header X-Frame-Options DENY;
|
||||
add_header X-XSS-Protection "1; mode=block" always;
|
||||
add_header Referrer-Policy "strict-origin";
|
||||
add_header Strict-Transport-Security "max-age=31536000" always;
|
||||
add_header Strict-Transport-Security "max-age=31536000" always;
|
||||
|
||||
#sub_filter_once off;
|
||||
#sub_filter_types text/html; # or *
|
||||
#sub_filter **CSP_NONCE** $cspNonce;
|
||||
Reference in New Issue
Block a user