You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Filip Sneppe <fi...@uptime.be> on 2003/10/27 11:19:28 UTC
[users@httpd] Reverse proxying a Tomcat on another machine with Apache 2.0
Hi,
I am having trouble reverse proxying a Tomcat running on a different
machine with Apache 2.0 (Both machines are running Debian Linux).
Currently, an Apache on the backend machine is sitting in front of
the Tomcat server.
In the future, I would like to get rid of an Apache running on the
backend server, and connect directly from the frontend Apache 2.0
to the Tomcat server. And here is where I run into problems...
This is my httpd.conf for the relevant virtual host:
<VirtualHost *>
ServerName new.site.be
UseCanonicalName Off
RewriteEngine On
ProxyRequests On
ProxyPreserveHost On
RewriteCond %{HTTP_HOST} ^new\.site\.be$
RewriteRule ^/(.*) http://10.0.10.207:8180/$1 [P,L]
</VirtualHost>
The problem is that this is returned when I connect
to the reverse proxy's port 80 and issue:
GET / HTTP/1.1
Host: new.site.be
This is returned:
HTTP/1.1 302 Moved Temporarily
Date: Mon, 27 Oct 2003 11:26:05 GMT
Server: Apache Tomcat/4.0.3 (HTTP/1.1 Connector)
Content-Type: text/html; charset=ISO-8859-1
Location: http://new.site.be:8180/index.html
Transfer-Encoding: chunked
etc.
I have tried various approached to get rid of the
":8180" returned by the Tomcat, or turn it into an
80, but to no avail...
- Playing with ProxyPassReverse & UseCanonicalName Off
didn't help...
- The closest I came was when I used environment variables
in combination with mod_header: I put the path-part
of the URI into an environment variable, and then
build my own "Location:" header before returning it
to the client. However, this doesn't work with
redirects, since what the server returns is different from
what the client asks for...
Any help is appreciated...
Regards,
Filip
---------------------------------------------------------------------
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