问题描述
我为网站配置了WordPress
和Nginx
。这是我的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
。
我已经尝试重命名plugins
和themes
目录,以查看它们是否有问题,但我没有。
此WordPress
可在我的本地计算机上与Apache
一起使用。
我已经搜索了StackOverflow
和WordPress
论坛,但找不到任何有关您可以看到您的网站但无法登录的问题,因为它返回了405 Error
有什么想法吗?谢谢