`
crabdave
  • 浏览: 1276066 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

Nginx 405 not allowed解决办法

 
阅读更多

Nginx 405 not allowed解决办法

 

       Apache、IIS、Nginx等绝大多数web服务器,都不允许静态文件响应POST请求,否则会返回“HTTP/1.1 405 Method not allowed”错误。

 

server {
   listen       80;
   server_name  域名;
   
   location /{
      root /www/文件目录;
      index index.html index.htm index.php;
      error_page 405 =200 http://$host$request_uri;
   }
}   

 

 

 

参考:

http://blog.csdn.net/zy799894671/article/details/38045513

分享到:
评论

相关推荐

    Nginx解决转发地址时跨域的问题

    Origin 'null' is therefore not allowed access. 这就是跨域问题。解决方案有不少,比较好的是服务器端配置CORS,但要求服务器端做更改。如果在不需要更改服务器端的情况下解决呢?尤其是需要在

    http请求405错误方法不被允许的解决 (Method not allowed)

    主要介绍了http请求405错误方法不被允许的解决 (Method not allowed),文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧

    Nginx反向代理proxy_cache_path directive is not allowed错误解决方法

    nginx: [emerg] “proxy_cache_path” directive is not allowed here in /etc/nginx/conf.d/default.conf:29 提示意思“proxy_cache_path指令不被允许”,在官网上查找了相关说明,也没有发现问题,最后看应用范围...

    Ngnix 数据接口报405错误问题解决

    全部接口报405 NOT Allowed 错误,如下图所示:   解决问题过程 在网上查了很多,试了几种方案 (1)前端将POST请求更改为GET请求;  (2)nginx配置加上如下代码 :  location / { error_page 405 =200 /...

    Nginx静态文件响应POST请求 提示405错误的解决方法

    Apache、IIS、nginx等绝大多数web服务器,都不允许静态文件响应POST请求,否则会返回“HTTP/1.1 405 Method not allowed”错误

    nginx配置引发的403问题解决办法

    主要介绍了nginx配置引发的403问题解决办法的相关资料,需要的朋友可以参考下

    nginx 如何实现if嵌套的方法示例

    nginx: [emerg] “if” directive is not allowed 当业务需要多个条件判断时,可以借助中间变量来实现 如:我们的网站在 pc 端有多个子域名, 而移动端只有一个域名,对应关系如下: www.test.com –> m.test.com...

    Nginx配置跨域请求Access-Control-Allow-Origin * 详解

    主要给大家介绍了关于Nginx配置跨域请求Access-Control-Allow-Origin * 的相关资料,文中通过示例代码介绍的非常详细,对大家学习或者使用Nginx具有一定的参考学习价值,需要的朋友们下面来一起学习学习吧

    Yii 访问 Gii(脚手架)时出现 403 错误

    You are not allowed to access this page. 1、调整了文件的读写权限,通过域名访问(外网访问、本地访问),仍然403报错。 2、 然后在服务器本地访问(http://localhost/backend/web/index.php?r=gii) 仍报错403...

    vewa_app2:VEWA 网络应用程序

    of this license document, but changing it is not allowed. 安装 用法 发展 要求 要在您的机器上运行此应用程序,您至少需要: PHP >=5.5 MySQL> = 5.5 启用了 mod rewrite 的 Apache Web Server 或 Nginx Web...

Global site tag (gtag.js) - Google Analytics