You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Garth Winter Webb <ga...@perijove.com> on 2003/05/14 01:32:02 UTC

[users@httpd] Can ProxyPass/Rewrite add a Host header?

Hi, I'm currently moving a website from one hosting company to another. 
After I paid for the service I realized that they do not provide a
static IP address.  Rather, you update your domain name do use their DNS
servers.  Right now, if I ask their domain name servers what IP my
domain has, it returns an IP for one of their servers (say, 1.2.3.4),
while bringing up my domain in a web browser brings me to my current
site.

What I'd like to do is set up a proxy server on a separate machine that
will proxy pass to 1.2.3.4 so that I can get everything working properly
on their servers and then flip the DNS switch.  However since they seem
to do name base virtual hosting, I also need to pass along the Host
header to let it know what domain I intend to access with 1.2.3.4.

ProxyPass and friends don't seem to have any options for this, and
Rewrite offers the [E] flag for setting environment variables, but I'm
not sure if this will do what I want.  Any suggestions, or pointers to
something I've missed?  If this is not possible I'll probably end up
buying a new domain name to use before the transition and point it at
the new hosting servers.

Note that the new hosting company offers access to their servers pre-dns
switch via a URL like:

    http://hosting.server.com/~clientname

but for reasons that are not relevant to this question, this will not
work for me.

Thanks!

-- 
Garth Winter Webb <ga...@perijove.com>

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Can ProxyPass/Rewrite add a Host header?

Posted by Joshua Slive <jo...@slive.ca>.


On Tue, 13 May 2003, Garth Winter Webb wrote:
> What I'd like to do is set up a proxy server on a separate machine that
> will proxy pass to 1.2.3.4 so that I can get everything working properly
> on their servers and then flip the DNS switch.  However since they seem
> to do name base virtual hosting, I also need to pass along the Host
> header to let it know what domain I intend to access with 1.2.3.4.

In 2.0 you have ProxyPreserveHost:
http://httpd.apache.org/docs-2.0/mod/mod_proxy.html#proxypreservehost

In 1.3 you might by able to mess with the DNS resolution on your proxy to
make it believe that the origin has a different name than its real name.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org