Nginx + WordPress ERR_TOO_MANY_REDIRECTS
Fresh installs a WordPress on Windows for development, and hits the ERR_TOO_MANY_REDIRECTS error message?
Tested URL : http://localhost/index.php/wp-admin/install.php
Tested :
- PHP 7.1.10
- WordPress 4.8.3
- Nginx 1.12.1
- MySQL 5.7.17
- Windows 10
upstream php { server 127.0.0.1:9999; server { listen 80; server_name localhost; root www/wordpress; location / { try_files $uri $uri/ /index.php?$args; location ~ \.php$ { include fastcgi.conf; fastcgi_intercept_errors on; fastcgi_pass php; location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { expires max; log_not_found off;
Solution
The missing of the default php page caused the “too many redirect” error messages, to fix this, add index index.php;
upstream php { server 127.0.0.1:9999; server { listen 80; server_name localhost; root www/wordpress; # fixed wordpress install ERR_TOO_MANY_REDIRECTS index index.php; location / { try_files $uri $uri/ /index.php?$args; location ~ \.php$ { include fastcgi.conf; fastcgi_intercept_errors on; fastcgi_pass php; location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { expires max; log_not_found off;
References
下一篇: PHP + Windows Call to undefined function mysql_connect()