转帖:https://blog.csdn.net/weixin_39483907/article/details/80813608html
背景:nginx
对接连连h5快捷支付时,需在连连支付成功页面点击返回商户按钮,跳转到商户的支付成功页面,商户的支付成功页面是html页面不是jsp页面,因为连连返回商户属于form表单提交post请求方式,因此会报405 not allowed 错误。为了让nginx的静态页面可以响应post请求,也在本论坛中找了好多相关的内容。最后用下面这种方式解决了问题。服务器
解决方案:jsp
修改nginx.conf配置文件,在server{}中添加error_page 405=200@405post
error_page 405 =200 @405; location @405 { proxy_method GET; proxy_pass http://localhost:8080; }
proxy_pass http://能够跟你的域名或者服务器地址。.net
该处理至关于将405错误的post请求改为get请求。第一次写博客,请多多包含。
---------------------
做者:weixin_39483907
来源:CSDN
原文:https://blog.csdn.net/weixin_39483907/article/details/80813608
版权声明:本文为博主原创文章,转载请附上博文连接!code