skip to Main Content

We have a multisite running with about 6 sites.

3 of our sites are accessible through the wp-admin the other 3 aren’t.

The browsers tells us that there are too many redirects going on. This only happens after we log in to the wp-admin. The wp-login page works fine.

We’ve had this issue before, solved the now working 3 sites with the following fix in our wp-config:

$_SERVER['HTTPS'] = 'on';

Also the front-end is working just fine, it’s only the wp-admin having issues.

Background information:
Server: Nginx + Apache. Starts at Nginx but then redirects to Apache
SSL: enabled

3

Answers


  1. According to the codex:

    If WordPress is hosted behind a reverse proxy that provides SSL, but
    is hosted itself without SSL, these options will initially send any
    requests into an infinite redirect loop. To avoid this, you may
    configure WordPress to recognize the HTTP_X_FORWARDED_PROTO header
    (assuming you have properly configured the reverse proxy to set that
    header).

    The following actions will solve the problem.

    Add this to wp-config.php. (codex reference)

    /* SSL Settings */
    define('FORCE_SSL_ADMIN', true);
    
    /* Turn HTTPS 'on' if HTTP_X_FORWARDED_PROTO matches 'https' */
    if (strpos($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') !== false) {
        $_SERVER['HTTPS'] = 'on';
    }
    

    Reference

    Login or Signup to reply.
  2. I had the same problem and could solve it. The problem was my admin user’s capabilities were set to subscriber instead of administrator. Probably from a membership plugin.

    In my database table wp_usermeta my admin-users
    wp_capabilities were set to “a:1:{s:10:”subscriber”;b:1;}”

    I change it to “a:1:{s:13:”administrator”;s:1:”1″;}” and I saw my Dashboard again.

    Login or Signup to reply.
  3. In my case where I have the nginx ingress controller as a reverse proxy in kubernetes cluster where it do a TLS termination and wordpress instancess in pods served by http protocol and nginx instead apache engine, the redirection loop happens when I had in the location / {...} block try_files $uri /index.php?$query_string; instead try_files $uri $uri/ /index.php?$args;

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search