Forum Discussion
hc_andy_35682
May 23, 2010Nimbostratus
Hi Hamish,
Thanks for the config. I've got a working config now based on matching the URL as seen below.
when HTTP_REQUEST {
if { [HTTP::header host] matches_glob "webmail.*.server.com" } {
persist source_addr 255.255.255.255 240
use pool WEBMAIL_HTTP_POOL
return
}
use pool VMTEST_PROXY_POOL
}
This works great and it does exactly what I want and I see the source address hitting the webmail_pool as being that of the school's IP address.
I wanted to improve on this and was wondering if you could make it match on destination IP address instead. You see all of the schools have a CNAME for their webmail.*.server.com that resolves to say 10.10.10.10.
Could I match on the destination IP address of 10.10.10.10 and redirect that to the webmail_pool??? I've tried the code below and it works BUT the source address that hits the webmail_pool is that of the real proxy server instead of the school's IP address which is not what I want to happen.
when HTTP_REQUEST {
if { [IP::addr [IP::local_addr] equals 10.10.10.10] } {
persist source_addr 255.255.255.255 240
use pool WEBMAIL_HTTP_POOL
return
}
use pool VMTEST_PROXY_POOL
}
I want it to persist based on the school's ip address which was possible when matching using the HTTP:xx code. Why doesn't it do the same when I change it to match on destination IP and keep the source IP as that of the school's IP address??? Is this just a limitation of the IP:xx code or do I need to modify the code in some way.
Appreciate any further guidance.
Thanks.
Andy