nginx static html page receives a post request, reported 405 not allowed error

nginx static html page receives a post request, reported 405 not allowed wrong
background:

对接连连h5快捷支付时,需在连连支付成功页面点击返回商户按钮,跳转到商户的支付成功页面,商户的支付成功页面是html页面不是jsp页面,由于连连返回商户属于form表单提交post请求方式,所以会报405 not allowed 错误。为了让nginx的静态页面能够响应post请求,也在本论坛中找了好多相关的内容。最后用下面这种方式解决了问题。

Solution:
Modify nginx.conf profile error_page added in server {} 405 = 200 @ 405

405 = 200 @ 405 error_page;
LOCATION @ 405 {
proxy_method GET;
proxy_pass HTTP: // localhost: 8080 ;
}
proxy_pass HTTP: // can with your domain name or server address .

Guess you like

Origin blog.51cto.com/13293070/2433558