Nginx + WordPress ERR_TOO_MANY_REDIRECTS
フレッシュは開発のためにWindowsにWordPressをインストールし、ERR_TOO_MANY_REDIRECTSエラーメッセージを表示しますか?
テスト済み
-
PHP 7.1.10
-
WordPress 4.8.3
-
Nginx 1.12.1
-
MySQL 5.7.17
-
ウィンドウズ10
ginx.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;を追加してください。
ginx.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;
}
}