httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adinarayana Kadiyam" <>
Subject Question on mod_rewrite
Date Mon, 06 May 2002 08:36:55 GMT

    We have got two apache webservers running at two diffrent machines.(let
s say the urls are and ) I am using another instance of apache
webserver on, running at port 7000.
    I want to distribute URL requests between
and based on the cookie value. I included the
lines in httpd.conf to enable this load balancing(proxy throughput method)

RewriteEngine   on
RewriteLog      "/path/to/rewrite.log"
RewriteLogLevel 0
RewriteLock     "/path/to/rewrite.lock"

RewriteMap      lb      prg:/path/to/
RewriteRule     ^/(.+)$ ${lb:$1:%{HTTP:Cookie}} [P,L]

    When I connect to, it gets index page from
one of the backend servers and displays it on the browser. 
After entering my username and passwd in the index page I click on submit
button. The request will go 
to and that will send this request to one of
the back end servers. The back end server sets username 
and serverid as cookies.

( The back end servers are DEC machines)

Here are the two cases.

1) when I directly connect to one of the backend servers like http://site1, supplying username and passwd and click 
on submit button
the following two lines are present in the HTTP header ( captured through
Set-Cookie: serverid=
Set-Cookie: username=xxxxx

2) when I connect to one of the backend servers through intermediate
instance ( server at 7000) and 
capture the HTTP header, the following lines are present
Set-Cookie: serverid=
X-Cache: MISS from

    Why is this difference ? When I print the cookie value in lb
pl(mentioned in RewriteMap), it displays 
serverid= The username cookie is missing. What could be the reason ?



This message (including any attachments) contains 
confidential information intended for a specific 
individual and purpose, and is protected by law. 
If you are not the intended recipient, you should 
delete this message and are hereby notified that 
any disclosure, copying, or distribution of this
message, or the taking of any action based on it, 
is strictly prohibited.

Visit us at

View raw message