Nginx配置安全策略总结_nginx安全策略_叹了口气的博客-CSDN博客
Nginx添加安全策略_nginx配置您的 web 服务器,使其包含带有 frame-ancestors 指令的 csp 报_TomicSun的博客-CSDN博客
正向代理:代理客户端访问(例如访问加速)
反向代理:代理服务端响应(例如负载均衡)
server {
listen 28443;
server_tokens off;
location /cas {
proxy_pass http://localhost:28442/cas;
proxy_redirect default;
proxy_read_timeout 600s;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host:$server_port;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# 防止xss
add_header X-XSS-Protection "1; mode=block";
# 防劫持
add_header X-Frame-Options "SAMEORIGIN";
# 防劫持
add_header X-Content-Type-Options "nosniff";
# 防劫持
add_header Content-Security-Policy "frame-ancestors 'self'";
# HSTS
add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload";
add_header Referrer-Policy origin;
add_header X-Permitted-Cross-Domain-Policies "master-only";
add_header X-Download-Options noopen;
index index.html index.htm;
}
}