httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Travis Sidelinger <>
Subject [users@httpd] mod_rewrite + mod_proxy troubles
Date Sat, 09 Feb 2008 13:26:08 GMT
We have a working production mod_proxy_balancer configuration for two 
backend web servers that is working great, except...  The backend web 
servers need the IP address of the clients to identify their location.

Yes, I had suggested just adding a location drop down so that users 
could select their own location.  Too inconvenient for the end user they 

They want "c_loc=xxx" added to the URL at the load balancer.  Okay, this 
sounds like a job for mod_rewrite.  This should be easy enough.

mod_proxy works great, mod_rewrite works great, I put the to together 
and they seem to not like each other.

Below is one of the many configurations I've tried.  The best I can get 
is the URI components are mixed up incorrectly.  Any ideas?

My build of apache:
tar -xvzf httpd-2.2.8.tar.gz
cd httpd-2.2.8
CFLAGS="-O2" ./configure --enable-http --enable-info=shared \
--enable-ssl=shared --enable-rewrite=shared --enable-speling=shared \
--enable-cgi=shared --enable-deflate=shared --enable-disk-cache=shared \
--enable-cache=shared --enable-proxy=shared --enable-proxy-http=shared \
--enable-proxy-balancer=shared --prefix=/vol/devl/loadbalancer
make install

    LogLevel debug

    <Proxy *>
        AddDefaultCharset off
        Order Allow,Deny
        Allow from all

    <Location /balancer-manager>
        SetHandler balancer-manager
        Order Allow,Deny
        Allow from

    <Location />
        Order Allow,Deny
        Allow from

    # Add the client's location number to the URL
    RewriteEngine On
    # Large list of locations goes here.  List removed to shorten for email
    RewriteCond %{REMOTE_HOST}  ^192\.168\.1\.[5-8]
    RewriteRule /.*\.aspx?\?{REQUEST_URI}&c_loc=730 [L]
    RewriteCond %{REMOTE_HOST}  ^192\.168\.220\.
    # Here are things I have tried
    RewriteRule "^/(.*)$" proxy:balancer://aquabrowser$1&c_loc=220" 
[QSA,L]   # I get 404 Error: "GET //cd/README&c_loc=220%22?test=1 
HTTP/1.1" in the logs of the backend server.
    RewriteRule "^(.*\?.*)$" 
"{REQUEST_URI}&c_loc=220" [L,P]  # I get 404 
Error: "GET /cd/README&c_loc=220?test=1 HTTP/1.1" in the logs of the 
backed server.
    # This is a long list other things I have tried.  Nothing seems to work.

    ProxyRequests Off
    ProxyVia On
    ProxyPreserveHost On

    ProxyPass /balancer-manager !

    # Catalog Development
    ProxyPass / balancer://aquabrowser/
    <Proxy balancer://aquabrowser>
        BalancerMember min=1 smax=20 
        #BalancerMember min=1 smax=20 
loadfactor=5 route=CAT1
        #BalancerMember min=1 smax=20 
loadfactor=5 route=CAT2
        ProxySet lbmethod=byrequests
        ProxySet stickysession=ABbalancer
        ProxySet nofailover=Off
        ProxySet maxattempts=3
        ProxySet timeout=5
        Order Allow,Deny
        Allow from

    ProxyPassReverse /
    #ProxyPassReverse /
    #ProxyPassReverse /

Travis Sidelinger

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message