When using ProxyPass to make a Drupal site available, the hostname of the site is not correctly determined. Instead of using $_SERVER['HTTP_HOST'] in bootstrap.inc, the host name should be determined from $_SERVER['HTTP_X_FORWARDED_HOST'] when the site is reached via a ProxyPass statement.

From http://httpd.apache.org/docs/1.3/mod/mod_proxy.html#proxypass:
"This directive allows remote servers to be mapped into the space of the local server; the local server does not act as a proxy in the conventional sense, but appears to be a mirror of the remote server. path is the name of a local virtual path; url is a partial URL for the remote server."

Comments

ghoti’s picture

StatusFileSize
new1.42 KB

I didn't see this before I posted a related issue: http://drupal.org/node/185161

I've found that adjusting $base_root is sufficient for me, because my HTTP_HOST is the same as my HTTP_X_FORWARDED_HOST. Is it really that common for the two to be different? If so, then these tickets are complementary.

But ... why use this extra $host variable? Is there any problem overwriting $_SERVER['HTTP_HOST'] itself? See my patch. I believe it does the same as yours, but with a little less code.

dpearcefl’s picture

Status: Needs review » Postponed (maintainer needs more info)

Is this still a problem in current D6?

dpearcefl’s picture

Status: Postponed (maintainer needs more info) » Needs work

We want your patch if it is still needed. Please resubmit it with a proper filename.

http://drupal.org/node/1054616
[description]-[issue-number]-[comment-number].patch

Status: Needs work » Closed (outdated)

Automatically closed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.