Fork me on GitHub

01 2021 档案

摘要:Nginx 关闭/屏蔽 PUT、DELETE、OPTIONS 请求 1、修改 nginx 配置 在 nginx 配置文件中,增加如下配置内容: if ($request_method !~* GET|POST|HEAD) { return 403; } 修改效果如下: 2、重启 nginx 服务 s 阅读全文
posted @ 2021-01-13 21:05 龙凌云端 阅读(9296) 评论(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 龙凌云端 阅读(6840) 评论(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 龙凌云端 阅读(5189) 评论(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 龙凌云端 阅读(23215) 评论(0) 推荐(1) 编辑
摘要:Java InputStream 中文乱码 问题描述 在调用 http POST ,获取请求体中的内容时,如果出现中文,在读取的时候,可能会引起“中文乱码”的现象。 如下读取方式 会 引起中文乱码 public XssRequestWrapper(HttpServletRequest request 阅读全文
posted @ 2021-01-07 18:53 龙凌云端 阅读(6835) 评论(4) 推荐(0) 编辑

点击右上角即可分享
微信分享提示