server{
add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload";
add_header Content-Security-Policy "default-src 'self' localhost:8080 'unsafe-inline' 'unsafe-eval' blob: data: ;";
add_header X-Frame-Options SAMEORIGIN;
add_header X-Content-Type-Options nosniff;
add_header Referrer-Policy 'origin';
add_header Permissions-Policy "accelerometer=(), camera=(), geolocation=(), microphone=(), payment=(), usb=(), midi=(), notifications=(), push=(), sync-xhr=()";
add_header X-Download-Options noopen;
add_header X-XSS-Protection 1;
add_header X-Permitted-Cross-Domain-Policies none;
}
server块添加即可
使用服务时可能会受到nginx的限制
#允许多个域名iframe嵌套,注意这里是用逗号分隔
add_header X-Frame-Options "ALLOW-FROM http://whsir.com/,https://cacti.org.cn/";