You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Cameron Beattie <kj...@orcon.net.nz> on 2005/06/28 04:49:47 UTC

[users@httpd] RewriteRule question: forward requests from one Apache server to another

I am trying to set up the following configuration:
1. Apache server with public IP address
2. Apache server behind NAT with no public IP address
3. Router with public IP address with port forwarding set up for port 8008 
to Apache server 2
4. Public DNS record server.mydomain.com resolves to IP address of server 1

When a user browses to server.mydomain.com I want a web site to be served up 
from from server 2.

I have set the following up in httpd.conf on server 1:
<VirtualHost *:80>
        ServerName server.mydomain.com
        RewriteEngine On
        RewriteRule ^/(.*) http://60.234.nnn.nn:8008/$1 [L,P]
</VirtualHost>

I have set the following up in httpd.conf on server 2:
<VirtualHost *:8008>
    ServerName server.mydomain.com
    DocumentRoot /var/www/html
</VirtualHost>

I can access the website locally by accessing the site on server 2, but not 
through server 1. If I enter http://server.mydomain.com I just get the 
default apache homepage, rather than the index.phtml page that I want to be 
served up. If I enter  http://server.mydomain.com/index.phtml I get a 404 
error.

I guess my rewriterule is wrong but I'm not sure how to fix it. Any help 
would be appreciated.

Regards

Cameron 


---------------------------------------------------------------------
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