Fresh在Windows上为开发安装了WordPress,并遇到了ERR_TOO_MANY_REDIRECTS
错误消息?
经测试的URL: http://localhost/index.php/wp-admin/install.php
经测试:
- PHP 7.1.10
- WordPress 4.8.3
- Nginx 1.12.1
- MySQL 5.7.17
- Windows 10
your-nginx\conf\nginx.conf
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;
}
}
解
默认php页面的缺失导致“太多重定向”错误消息,要解决此问题,请添加index index.php;
your-nginx\conf\nginx.conf
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;
}
}
参考文献
翻译自: https://mkyong.com/nginx/nginx-wordpress-err_too_many_redirects/