WordPress.org

Ready to get started?Download WordPress

Forums

Proxy Real IP
Similar problem also with HTTP_HOST, redirection loop (3 posts)

  1. Ov3rfly
    Member
    Posted 1 year ago #

    Seems that a similar server misconfiguration also fails to set HTTP_HOST in the correct way, so if somebody on such a server moves a blog fom http://example.com/ to http://blog.example.com/ it will end up hanging in an endless redirection loop as HTTP_HOST is still set as example.com

    The plugin solves the IP issue, but not the hostname, maybe you could add this correction as an option (default disabled, enable via filter) in a future update or as own plugin. At the moment I use this added to your proxy-real-ip.php and it corrects the above issue:

    if ( ! empty( $_SERVER['HTTP_X_FORWARDED_HOST'] ) ) {
        $_SERVER['HTTP_HOST'] = $_SERVER['HTTP_X_FORWARDED_HOST'];
    }

    Note: The Plugin URI: wordpressforedu.com seems to lead to nowhere, it should maybe lead here or to a page which also leads here.

    http://wordpress.org/extend/plugins/proxy-real-ip/

  2. Sam Parsons
    Member
    Plugin Author

    Posted 1 year ago #

    @Ov3rfly, thanks for the report.

    I think that could be a useful addition for some purposes, and it seems to me that it fits in scope of this plugin. I'll do some testing on our servers first before publishing the change.

    Oh, and thanks for the tip about wordpressforedu.com -- need to remove that line from the plugin config too!

  3. Ov3rfly
    Member
    Posted 1 year ago #

    The hostname problem happens if e.g. on Apache ProxyPreserveHost is turned off and example.com is preset as host for that vhost and the user tries to install WordPress on www.example.com instead example.com or tries to move an installation later as explained above.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic