Fork me on GitHub
摘要: Nginx 关闭/屏蔽 PUT、DELETE、OPTIONS 请求 1、修改 nginx 配置 在 nginx 配置文件中,增加如下配置内容: if ($request_method !~* GET|POST|HEAD) { return 403; } 修改效果如下: 2、重启 nginx 服务 s 阅读全文
posted @ 2021-01-13 21:05 龙凌云端 阅读(8548) 评论(0) 推荐(1) 编辑
摘要: Nginx 设置禁用 OPTIONS 请求 1、修改 nginx 配置 在 nginx.conf 配置文件中,增加如下内容: if ($request_method ~* OPTIONS) { return 403; } 效果如下: 2、重启 nginx 服务 systemctl restart n 阅读全文
posted @ 2021-01-13 20:54 龙凌云端 阅读(6470) 评论(0) 推荐(0) 编辑
摘要: Nginx 防止跨站脚本 Cross-Site Scripting (XSS) 1、修改 nginx 配置 在 nginx.conf 配置文件中,增加如下配置内容: add_header X-XSS-Protection "1; mode=block"; X-XSS-Protection 的字段有三 阅读全文
posted @ 2021-01-13 20:44 龙凌云端 阅读(4771) 评论(0) 推荐(0) 编辑
摘要: Nginx 解决内容安全策略CSP(Content-Security-Policy)配置方式 1、修改 nginx 配置文件 在nginx.conf 配置文件中,增加如下配置内容: add_header Content-Security-Policy "default-src 'self' loca 阅读全文
posted @ 2021-01-13 20:41 龙凌云端 阅读(21174) 评论(0) 推荐(1) 编辑