Title: reverse proxy in depth tutorial?

This is slightly off-topic, but as it hits on Mason, optimizing mod_perl for performance, and is covered in passing in the practical and mod_perl cookbook books, I figured I'd ask here first.

Can anyone point me toward a good in depth article or documentation on using reverse proxying with apache? And no, I'm sorry but the apache reference docs on modules and directives is too spartan. I'm looking to minimize memory utilization and maximize performance, and am slowly working through the tips from the books and available online documentation.

Most everything I'm stumbled upon has been short on detail and examples. For instance, I never found an example of how to just reverse proxy everything for a given backend server. All the examples I saw showed how to proxy something like http://foo/bar but not http://foo. Eventually I came up with the following:

[Reverse Proxy]
...
Listen 192.168.1.1:80
RewriteEngine on
RewriteRule     ^/?(.*) http://127.0.0.1:80/$1 [P]
ProxyPassReverse / http://127.0.0.1:80/
...

[Backend Server]
...
Listen 127.0.0.1:80
...

Is this kosher?

Is there a better way to do this?

A way to do it without mod_rewrite using only mod_proxy directives?

Are there any strong arguments against using a mod_proxy/mod_rewrite httpd accelerator? Or preferred alternatives?

Using the loopback for the backend has the security advantage of completely isolating the backend from any direct communication with external hosts. How do I keep the backend on 127.0.0.1 _and_ handle name based virtual hosts?

What are the issues with regard to virtual hosting and ssl?

Any tips on keeping the config files maintainable?

For instance if I'm doing a mason site with co-branding through multiple component roots... What would minimal configurations for proxy and backend servers look like in order to redirect an externally exposed ip address on the proxy to a backend on 127.0.0.1 and still preserve the name based virtual hosts? It that possible? What are the variations, tradeoffs, and issues scaling it out to multiple physical servers? etc.

--
Garrett Goebel
IS Development Specialist

ScriptPro                  Direct: 913.403.5261
5828 Reeds Road            Main:   913.384.1008
Mission, KS 66202          Fax:    913.384.2180
www.scriptpro.com          garrett at scriptpro dot com

Reply via email to