01 2021 档案
摘要:Nginx 关闭/屏蔽 PUT、DELETE、OPTIONS 请求 1、修改 nginx 配置 在 nginx 配置文件中,增加如下配置内容: if ($request_method !~* GET|POST|HEAD) { return 403; } 修改效果如下: 2、重启 nginx 服务 s
阅读全文
摘要:Nginx 设置禁用 OPTIONS 请求 1、修改 nginx 配置 在 nginx.conf 配置文件中,增加如下内容: if ($request_method ~* OPTIONS) { return 403; } 效果如下: 2、重启 nginx 服务 systemctl restart n
阅读全文
摘要:Nginx 防止跨站脚本 Cross-Site Scripting (XSS) 1、修改 nginx 配置 在 nginx.conf 配置文件中,增加如下配置内容: add_header X-XSS-Protection "1; mode=block"; X-XSS-Protection 的字段有三
阅读全文
摘要:Nginx 解决内容安全策略CSP(Content-Security-Policy)配置方式 1、修改 nginx 配置文件 在nginx.conf 配置文件中,增加如下配置内容: add_header Content-Security-Policy "default-src 'self' loca
阅读全文
摘要:Java InputStream 中文乱码 问题描述 在调用 http POST ,获取请求体中的内容时,如果出现中文,在读取的时候,可能会引起“中文乱码”的现象。 如下读取方式 会 引起中文乱码 public XssRequestWrapper(HttpServletRequest request
阅读全文