WordPress错误404在从Apache到Nginx的迁移中
我在Apache服务器上安装了一个工作的WordPress安装,并想在VPS上迁移到NGINX服务器。我复制了所有文件,设置了MSQL连接等。除了已发表的文章,所有文件似乎都很好,所有这些文章都会产生404个错误。管理区工作正常,没有明显的问题。
虚拟服务器配置是:
server {
if ($host = www.xxx.es) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name xxx.es www.xxx.es;
return 301 https://www.xxx.es$request_uri;}
server {
server_name xxx.es www.xxx.es;
root /home/www/xxx.es/html/;
index index.php;
#listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/www.xxx.es/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/www.xxx.es/privkey.pem; # managed byCertbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
if (!-f $document_root$fastcgi_script_name) {return 404;}
fastcgi_param HTTP_PROXY "";
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
我尝试了其他问题的解决方案,但没有成功。感谢您的帮助
I have a working WordPress installation on an Apache server and wanted to migrate to an NGINX server on a VPS. I've copied all the files, set up the MSQL connection, etc. and everything seems to work fine except the published articles, which all give 404 errors. The admin area works fine, with no apparent problems.
The virtual server configuration is:
server {
if ($host = www.xxx.es) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name xxx.es www.xxx.es;
return 301 https://www.xxx.es$request_uri;}
server {
server_name xxx.es www.xxx.es;
root /home/www/xxx.es/html/;
index index.php;
#listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/www.xxx.es/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/www.xxx.es/privkey.pem; # managed byCertbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
if (!-f $document_root$fastcgi_script_name) {return 404;}
fastcgi_param HTTP_PROXY "";
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
I have tried the solutions of other questions without success. Thanks for the help
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试改变您的部分:
对此:
Try to change your part:
to this one: