Trevor Phillips wrote:
> 
> I'm trying to set up a lightweight Apache Proxy as reccomended for mod_perl
> situations. I have the proxy set up on a different box, and for the proxy
> config I have:
> 
> <VirtualHost *:80>
> ProxyPass        / http://the.other.machine:80/
> ProxyPassReverse / http://the.other.machine:80/
> </VirtualHost>
> 
> This works fine, except "the.other.machine" gets the Host header as
> "the.other.machine" and NOT whatever is passed to the proxy by the client. As a
> result, virtual servers with the same IP but different name are NOT working!
> 
> Help! Any ideas on getting around this?

Ok, I've managed to pass the clients Virtual Host name on to the REAL server,
by hacking mod_proxy_add_forward.c and adding in:
   ap_table_set(r->headers_in, "X-Virtual-Host",ap_get_server_name(r));

I can't seem to set it directly to "Host", though; I suspect it is overridden
later with "the.other.machine" as host, which is why I'm passing it as another
name.

So, can anyone tell me how I can adjust it to override the other Host header??

Alternatively, how can I get the end server to reinstate this as the real Host
header? It has mod_perl (of course), so I can do things there. I've tried
incorporating the fix back in the PostReadRequestHandler phase, but this phase
seems to happen AFTER the Virtual Servers are sorted out, so isn't much help.
Would this work better in some other phase??

Ideally, it'd be nice to have more control over Virtual servers; say, have a
perl handler determine which Virtual server to use, based on whatever info it
wants to use.

Any help or ideas on this would be most appreciated!! I need SOME solution ASAP
(impending traffic flood this weekend), and I'd like a "nice" solution in the
long run...

-- 
. Trevor Phillips             -           http://jurai.murdoch.edu.au/ . 
: CWIS Technical Officer         -           [EMAIL PROTECTED] : 
| IT Services                       -               Murdoch University | 
 >------------------- Member of the #SAS# & #CFC# --------------------<
| On nights such as this, evil deeds are done. And good deeds, of     /
| course. But mostly evil, on the whole.                             /
 \      -- (Terry Pratchett, Wyrd Sisters)                          /

Reply via email to