fix(ui): Fix xss attact

This commit is contained in:
wizardchen
2025-09-15 19:13:59 +08:00
committed by lyingbug
parent 1aac37d3fd
commit 0908f9c487
13 changed files with 518 additions and 43 deletions
+7
View File
@@ -3,6 +3,13 @@ server {
server_name localhost;
client_max_body_size 50M;
# 安全头配置
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-XSS-Protection "1; mode=block" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' data: https: http:; font-src 'self' data:; connect-src 'self' http: https: ws: wss:; frame-ancestors 'self';" always;
# 错误日志配置
error_log /var/log/nginx/error.log warn;
access_log /var/log/nginx/access.log;