• Hi there,

    I recently upgraded successfully my wordpress instances, though I had to do a few fixes. I’m running on a virtual host on a shared apache instance where they are using mod proxy.

    Unfortunately $_SERVER[“HTTP_HOST”] returns localhost:11008 (on our machine), and so all URIs created in the wordpress code don’t work remotely.

    My system administrator tried adding the PreserveProxyHost On configuration setting but that didn’t seem to make much difference. My work around was to replace all instances of $_SERVER[“HTTP_HOST”] with $_SERVER[“HTTP_X_FORWARDED_HOST”]

    I’ve published a full explanation below if you need more information:
    https://www.thekua.com/atwork/2008/10/wordpress-262-interoperability-with-apache-2-mod-proxy/

    Should I add a bug to the wordpress bug DB?

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter thekua

    (@thekua)

    I should have mentioned, the install fails, as does logging in, etc, unless I patch all the files listed in that blog entry above before I do an install/upgrade.

    I get wordpress to work without modification behind my reverse proxy by adding the following directive to my virtual host configuration (on the backend server):

    RequestHeader set Host https://www.example.com

    Where https://www.example.com is the hostname you want WP to perform redirects for (as opposed to 127.0.0.1). You will need to have mod_headers enabled for this directive to be recognized.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘$_SERVER[“HTTP_HOST”] fails with apache mod proxy’ is closed to new replies.