User Tools

Site Tools


wiki:wordpress_troubleshooting

This is an old revision of the document!


Wordpress troubleshooting

Too many redirects problem

This happened after WP was installed without SSL and then after some days, SSL was added. It only happened when trying to access /wp-admin/ route.

Adding the following lines of code at the after “/* Add any custom values between this line and the “stop editing” line. */” line of wp-config.php:

if (strpos($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') !== false)
   $_SERVER['HTTPS']='on';

In the proxy settings for nginx add these directives:

...
  location / {
      proxy_set_header Host            $host;
      proxy_set_header X-Forwarded-For $remote_addr;
      proxy_set_header X-Forwarded-Proto $scheme;
      proxy_pass http://your-wordpress-docker-upstream$request_uri;
    }
...

Tested on

  • WP installed in docker container behind nginx, with Letsencrypt https

See also

References

wiki/wordpress_troubleshooting.1660649033.txt.gz · Last modified: 2022/08/16 13:23 by antisa

Except where otherwise noted, content on this wiki is licensed under the following license: CC0 1.0 Universal
CC0 1.0 Universal Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki