Nginx + WordPress ERR_TOO_MANY_REDIRECTS - LearnHowToCode SarkariResult.com Interview Questions and Answers LearnHowToCodeOnline
Nginx + WordPress ERR_TOO_MANY_REDIRECTS

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 :
  1. PHP 7.1.10
  2. WordPress 4.8.3
  3. Nginx 1.12.1
  4. MySQL 5.7.17
  5. 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;
  }
  
 }

Solution

The missing of the default php page caused the “too many redirect” error messages, to fix this, add 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;
  }
  
 }

References

  1. Nginx + WordPress recipes

About Mariano

I'm Ethan Mariano a software engineer by profession and reader/writter by passion.I have good understanding and knowledge of AngularJS, Database, javascript, web development, digital marketing and exploring other technologies related to Software development.

0 comments:

Featured post

Political Full Forms List

Acronym Full Form MLA Member of Legislative Assembly RSS Really Simple Syndication, Rashtriya Swayamsevak Sangh UNESCO United Nations E...

Powered by Blogger.