Nginx下使用rewrite规则 匹配指定规则 到 指定文件 , 然后用 Ajax 的 POST 方法去请求 JSON,则报 405 Method not allowed 错误。
解决方法: 重定向 405 错误码到 200
location ~ ^/(js/sandbox|uploads/rs|img)/ {
root /data/runjs/webapp;
error_page 405 =200 $uri;
}
参考http://www.oschina.net/question/12_77690