Support » Fixing WordPress » WordPress SSL and reverse proxy. Redirection error

  • I have a web that have to run behind a reverse proxy, and the login and administration panel must be under SSL

    Proxy url:
    Real url: (where wordpress is installed)

    Everything works ok, but when i try to access administration panel using or it redirects to (I have FORCE_SSL_LOGIN and FORCE_SSL_ADMIN activated),so the proxy doesn’t recognize the direction and firefox returns server not found error.

    I think the problem is in wp-login.php with the value returned by HTTP_HOST

    // Redirect to https login if forced to use SSL
    if ( force_ssl_admin() && !is_ssl() ) {
    if ( 0 === strpos($_SERVER[‘REQUEST_URI’], ‘http’) ) {
    wp_redirect(preg_replace(‘|^http://|’, ‘https://’, $_SERVER[‘REQUEST_URI’]));
    } else {
    wp_redirect(‘https://’ . $_SERVER[‘HTTP_HOST‘] . $_SERVER[‘REQUEST_URI’]);

    Is there any solution to force wordpress to take the proxy url instead the real url like it must be?


  • The topic ‘WordPress SSL and reverse proxy. Redirection error’ is closed to new replies.