从Apache到Nginx:错误310,太多的redirect

我正在将一个WordPress的博客从一个基于Apache的networking服务器转移到一个基于Nginx的networking服务器 。 简单的步骤,我想:

我能得到什么?

一个华丽,美丽的 “错误310:太多redirect”:(

我可以在www.example.com/wp-login.php上看到login页面,但是我的源用户不工作,我无法访问WordPress仪表板。 我已经从phpMyadmin修改了一个pipe理员帐号,设置了一个新的密码,并select了MD5encryption,尽pipe当我从Apache转移到Apache或Nginx到Nginx时,这个工作起作用了。

我真的不明白为什么有太多的redirect错误。 我尝试禁用所有插件(将/ wp-content / plugins重命名为/ wp-content / oldplugins,或者用SQL查询禁用所有插件),但是再次运气不佳。

对不起,很长的问题。 我希望我已经说清楚了

编辑:这是nginxconfiguration文件,以防万一:)

server { listen 80; server_name www.example.com; rewrite ^/(.*) http://example.com/$1 permanent; } server { listen 80; access_log /var/www/example.com/log/access.log; error_log /var/www/example.com/log/error.log info; server_name example.com; root /var/www/example.com; location / { index index.php; # if the requested file exists, return it immediately if (-f $request_filename) { break; } # all other requests go to WordPress if (!-e $request_filename) { rewrite . /index.php last; } } ## Images and static content is treated different location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ { access_log off; expires 30d; root /var/www/example.com; } ## Parse all .php file in the /var/www directory location ~ .php$ { fastcgi_split_path_info ^(.+\.php)(.*)$; fastcgi_pass backend; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /var/www/example.com$fastcgi_script_name; include fastcgi_params; fastcgi_param HTTP_HOST example.com; fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; fastcgi_intercept_errors on; fastcgi_ignore_client_abort on; fastcgi_read_timeout 180; } ## Disable viewing .htaccess & .htpassword location ~ /\.ht { deny all; } } 

我想在另一个答案我的问题 :在Apache Web服务器上的源文件夹的Apache文件夹apache:apache作为用户:组,并在'scping'该文件夹到我的新的Nginxnetworking服务器后,该用户和该组不再有效。 我做了适当的chown -R www-data:www-data到新的WP文件夹,但是…可以这个提示来回答吗?

尝试:

 location / { try_files $uri $uri/ /index.php; } 

nginx是否将适当的“主机”头传递给FastCGI服务器? WordPress检查这个头,如果它不等于数据库中的设置,则执行redirect。 它看起来像你应该检查你的/etc/nginx/fastcgi_params并设置像fastcgi_param HTTP_HOST example.com; 那里。