You might also want to look at the new proxy code in a current snapshot.
Chuck
On Thursday, January 24, 2002, at 06:10 PM, Ian Holsman wrote:
if only you posted this a week or two ago it might have made it into the 1.3.23 release.
I'm looking at the patch, and i'm not all that familiar with the 1.3 tree. it looks like if the option is set you don't set the host AT ALL.
I'm assuming that this is because it is set already.
would it be cleaner if you set the host in this section
+��� if (!conf->preserve_host_set) {
+������� if (destportstr != NULL && destport != DEFAULT_HTTP_PORT)
+������ ��� ap_bvputs(f, "Host: ", desthost, ":", destportstr, CRLF, NULL);
+������� else
+������ ��� ap_bvputs(f, "Host: ", desthost, CRLF, NULL);
+��� }
���� else {
������� ������� ap_bputs(f, "Host: ", <current v-host>:<current-
port>,CRLF,NULL);
���� }
the reason I'm asking is due to server aliasing. you could any number of host's
coming in from the user which match a particular vhost setting.
the other question I have about the patch is would it be better if this was a regex
expression
eg. s/www.(.*).com/ws.$1.com/
that way internally you could access the "proxied" webserver directly with a browser, without
having to resort to tricks.
> -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Thursday, January 24, 2002 10:27 AM > To: Apache .Org Mod_Proxy > Subject: patch: proxy-preserve-host > > > In the current code you can't reverse proxy to virtual hosts > or any other > host that relies on a host header because the original host header is > deleted and a new host header is created using the proxy's idea of the > hostname. This patch creates a config option called > ProxyPreserveHost which > allows you to tell apache to send the original host header > instead of a new > one. > > Might anyone else be interested in this patch or is my case unique? > > It's really only useful during reverse proxying and not during regular > proxying so do you think that I should only enable the option if > ProxyRequests is not on? Or, better yet, should I detect if a certain > proxied request is reverse and not regular and only then preserve the > original host header? If so, then what's a good way to distinguish the > reverse from the regular proxied request? > > Additionally, I'll may be using this in a production > environment so I'd > really appreciate knowing of any potential bugs that anyone might see. > Anyone have any other suggestions? > > - Gabriel Russell > > (See attached file: proxy-preserve-host.diff) >
