LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: URL forwarding

To: "LinuxVirtualServer.org users mailing list." <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: URL forwarding
From: Konstantin Ivanov <Konstantin.Ivanov@xxxxxxxxxxxxxxxxxx>
Date: Tue, 29 May 2007 07:02:20 -0500
Dr. Volker Jaenisch wrote:
Hi Konstantin!
Konstantin Ivanov schrieb:
Hello,

Is it possible based on the URL address for the load balancer to forward the requests to a particular real servers. What I need to do is for example for a domain name domain1.com just server1 and server2 will respond, and for domain2.com server 1 and server3 will respond. I tried looking at UltraMonkey-L7 project but you can match only the file names in the URL like this:
l7vsadm -A -t 192.168.8.58:80 -m url --pattern-match '*.html' -s rr
l7vsadm -a -t 192.168.8.58:80 -m url --pattern-match '*.html' -r 10.0.0.10:80
Quoting http://sourceforge.jp/projects/ultramonkey-l7/document/admin_manual_en-v1.3/en/1/admin_manual_en-v1.3.txt
2.2.2.2 URL module (url) option
--pattern-match character-string (module-args)
Defines the URL character string that should not be allowed to pass through till the real server. This can take 127 english characters. Shell wildcard notation is allowed. (The "*" can match zero or more arbitrary characters --> Match any string
The "?" can match any single character --> Match any single character)
The character-string should be enclosed with ' (Single Quote character)
If complete matching or comparision is required for URL, then * might be needed.
Example: --pattern-match '*/index.html*'


I never used l7vsadm but there is nowhere written that the matching string operates only on the path portion of the URL.

Have you tried e.g.

l7vsadm -a -t 192.168.8.58:80 -m url --pattern-match 'domain2.com*' -r 10.0.0.10:80
or
l7vsadm -a -t 192.168.8.58:80 -m url --pattern-match '*domain2.com*' -r 10.0.0.10:80

Best Regards,

Volker

I have tried domain.com but does not work. Will be great if it does.



<Prev in Thread] Current Thread [Next in Thread>