Linux Blog

Reverse Proxy with ModProxy

Filed under: Linux Software — TheLinuxBlog.com at 3:30 am on Wednesday, February 2, 2011

Reverse Proxy with Mod Proxy

Mod proxy is a versatile module for apache that has many uses. One of its many uses is the reverse proxy feature. Lets say you have multiple web servers behind a router and want to give the outside world access to each server. Your router can only open port 80 for one host, but with modproxy you can direct users to different servers depending on which sub domain or directory they are requesting. This also works for external sites that may not be on your private network.

Hit the jump to see how.

To do this is quite simple:

1
2
3
4
5
6
7
8
<code>ProxyRequests Off</code>
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
 
ProxyPass /foo http://foo.example.com/bar
ProxyPassReverse /foo http://foo.example.com/bar

Example from: http://httpd.apache.org/docs/2.0/mod/mod_proxy.html

Basically when some one requests /foo on your web server that the public port 80 points to, it proxies the request to foo.example.com/bar. The reverse is to make sure that the requests come back to the user that requested it. As the documentation states you should secure your servers before using mod_proxy which is probably a wise choice, but you should always secure your servers.





Random Man Pages:
lmhosts
pamfile
iso_8859_1

1 Comment »

Comment by ProxyUser

August 13, 2011 @ 2:49 pm

WOW!!
Fantastic post dude!

I’m very impressed by your post!
But I use proxies from proxylists like http://www.AnonTux.com

But nice post dude!

RSS feed for comments on this post. TrackBack URI

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>