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."
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | bootstrap.inc-183537.patch | 1.42 KB | ghoti |
| bootstrap.inc__7.patch | 2.05 KB | jpulles |
Comments
Comment #1
ghoti commentedI 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.
Comment #2
dpearcefl commentedIs this still a problem in current D6?
Comment #3
dpearcefl commentedWe 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