Nginx静态文件响应post请求405 method not allowed

发表于 : 2017-09-15   · CC BY-NC-SA 4.0 ·   1781 人浏览

问题:Nginx 405 method not allowed

网络上各种方法,都尝试了

这个个人测试可以用

本人主机配置 系统: CentOS Linux 7.4.1708 软件: Nginx -Tengine2.2.0

Nginx网站配置文件添加

重定向405错误码到200

我添加在server{...}里面的最下面

server
{
    location ~ (.*\.json)
    {
    root /www/wwwroot/book;   #这是我网站根目录
    error_page 405 =200 $1;
    }
}
Nginx centos 405 method not allowed