【问题标题】:WordPress, Nginx | wp-admin returns 405 but I can access websiteWordPress, Nginx | wp-admin 返回 405 但我可以访问网站
【发布时间】:2020-12-23 10:57:22
【问题描述】:

我有网站的WordPressNginx 配置。这是我的Nginx conf 文件

server {
    listen 80;
    server_name  website.com;

    root   /var/www/html;
    index  index.php;

    location / {
    if ($request_uri ~ ^/(.*)\.html) {
        return 302 /$1;
        }
    }

    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /var/www/html;
    }
    
    location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass   unix:/var/run/php/php7.3-fpm.sock;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include        fastcgi_params;
    }
}

主要问题是网站可以运行,但我无法登录。当我转到/wp-login.php 时,我可以输入用户名和密码,但问题是在下一页显示405 Not Allowed,我不知道为什么。

我还在控制台中的Network 选项卡中看到它转到/wp-admin.php,但随后又返回/wp-login.php 并显示405 错误。

我已经尝试重命名 pluginsthemes 目录,看看它们是否有问题,但我没有。

这个WordPress 可以在我的本地机器上使用Apache

我已经搜索了StackOverflowWordPress 论坛,但我找不到任何关于您可以看到您的网站但无法登录的问题,因为它返回405 Error

有什么想法吗?谢谢

【问题讨论】:

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


    【解决方案1】:

    又一次。我在这里回答我自己的问题

    我按照this 指南解决了这个问题

    问题在于Nginx 配置

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-09-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-11-20
      相关资源
      最近更新 更多