Proxy throughput method of load balancing

New to mod_rewrite? This is a good place to start.

Postby adinarayanak » Mon May 06, 2002 12:11 am

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 following
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, supplying username and passwd and click
on submit button
the following two lines are present in the HTTP header ( captured through ethereal)
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 in RewriteMap), it displays
serverid= The username cookie is missing. What could be the reason ?

Posts: 1
Joined: Sun May 05, 2002 4:00 pm
Location: India

Return to Beginner's Corner

Who is online

Users browsing this forum: No registered users and 6 guests