【问题标题】:Getting 405 when posting to php file发布到 php 文件时出现 405
【发布时间】:2015-06-27 23:42:27
【问题描述】:

我有一个发布到mysite.com/s/form.php 的 html 表单,但是当我提交表单时出现错误 405 Not Allowed。这可能是权限问题吗?或者是别的什么?我被困在这一点上。

这是我当前的配置:

server {
  listen 80 default_server;
  listen [::]:80 default_server ipv6only=on;
  server_name localhost;
  root /var/www/mysite.com/site/;
  index index.html index.htm index.php;

  location / {
    try_files $uri $uri/ =404;
  }
  location /s/ {
    alias /var/www/mysite.com/s/;
  }
}

有人可以指出这里出了什么问题吗?

【问题讨论】:

    标签: nginx http-post http-status-code-405


    【解决方案1】:

    我忘记包含使 php 工作的位,所以 nginx 认为是 POST 被发送到静态文件,这是 nginx 不允许的。

    【讨论】:

    • 你能解释一下你做了什么吗?
    猜你喜欢
    • 2015-11-14
    • 1970-01-01
    • 2013-11-04
    • 1970-01-01
    • 1970-01-01
    • 2011-03-08
    • 1970-01-01
    • 2019-09-05
    • 2010-10-10
    相关资源
    最近更新 更多