You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Danny Scott <Da...@gpc.genpt.com> on 2003/12/05 19:39:04 UTC

[users@httpd] rewrite rules help

We have an application server listening to port 8080. The app
server cannot listen to any other port. We need a way to have
requests sent to port 8081 transparently redirected to port 8080.
I am thinking a rewrite rule possibly with a combination of a reverse
proxy might be the answer. This is above my level of expertise and
any guidance would be appreciated. I will enclose part of my httpd.conf
file that I have modified below. Currently when I telnet to port 8080
and do a "GET / HTTP/1.0" followed by a couple of carriage returns
the app server answers with what I expect. If I do the same to port
8081 I get some output back from apache but nothing from the app
server. If I use my browser to go to port 8081 on this server it does
redirect me to port 8080 and everything looks fine. I need this to work
on the app server level though. Again any help would be very much
appreciated.
 
<VirtualHost 10.10.10.193:8081>
RewriteEngine on
RewriteRule   ^/(.*) http://10.10.10.193:8080/$1
<http://10.10.10.193:8080/$1> 
ProxyPass / http://10.10.10.193:8080 <http://10.10.10.193:8080> 
ProxyPassReverse / http://10.10.10.193:8080 <http://10.10.10.193:8080> 
</VirtualHost>


Re: [users@httpd] rewrite rules help

Posted by Joshua Slive <jo...@slive.ca>.
On Fri, 5 Dec 2003, Danny Scott wrote:
> server. If I use my browser to go to port 8081 on this server it does
> redirect me to port 8080 and everything looks fine. I need this to work
> on the app server level though. Again any help would be very much
> appreciated.

I don't undertand. You are saying your browser works fine.  So what
exactly is the problem?

> <VirtualHost 10.10.10.193:8081>
> RewriteEngine on
> RewriteRule   ^/(.*) http://10.10.10.193:8080/$1
> ProxyPass / http://10.10.10.193:8080
> ProxyPassReverse / http://10.10.10.193:8080
> </VirtualHost>

There is a contradiction there.  The RerwiteRule does an
external-redirect, which essentially just sends a message back to the
server asking it to make a new request on the new port.

The ProxyPass, on the other hand, grabs the data itself from :8080 and
returns it to the client, without the client ever knowing where it came
from.

Either of those should be fine, depending on your requirements.  But
having them both doesn't make sense.

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