Forum Discussion
lunitic_56137
Nimbostratus
Feb 14, 2013URI Query question
I have an environment that has 3 different uri conditions that contain a queries.
Scenario 1
If a uri query contains "foo", add "&bar" at the end, and send it to the foo_bar_pool
Scena...
nitass
Employee
Feb 15, 2013e.g.
[root@ve10:Active] config b virtual bar list
virtual bar {
snat automap
destination 172.28.19.252:80
ip protocol 6
rules myrule
profiles {
http {}
tcp {}
}
}
[root@ve10:Active] config b rule myrule list
rule myrule {
when HTTP_REQUEST {
if {[URI::query "?&[HTTP::query]" bar] ne ""} {
pool foo_bar_pool
} elseif {[URI::query "?&[HTTP::query]" foo] ne ""} {
HTTP::uri "[HTTP::uri]&bar=1234"
pool foo_bar_pool
} elseif {[URI::query "?&[HTTP::query]" USER-ID] ne ""} {
pool user_pool
} else {
do something
}
}
}
[root@ve10:Active] config b pool foo_bar_pool list
pool foo_bar_pool {
members 200.200.200.101:80 {}
}
[root@ve10:Active] config b pool user_pool list
pool user_pool {
members 200.200.200.111:80 {}
}
foo
[root@ve10:Active] config ssldump -Aed -nni 0.0 port 80
New TCP connection 1: 172.28.19.251(50138) <-> 172.28.19.252(80)
1360889294.2045 (0.0009) C>S
---------------------------------------------------------------
HEAD /something?foo=abcdef HTTP/1.1
User-Agent: curl/7.15.5 (i686-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
Host: 172.28.19.252
Accept: */*
---------------------------------------------------------------
New TCP connection 2: 200.200.200.10(50138) <-> 200.200.200.101(80)
1360889294.2056 (0.0009) C>S
---------------------------------------------------------------
HEAD /something?foo=abcdef&bar=1234 HTTP/1.1
User-Agent: curl/7.15.5 (i686-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
Host: 172.28.19.252
Accept: */*
---------------------------------------------------------------
bar
[root@ve10:Active] config ssldump -Aed -nni 0.0 port 80
New TCP connection 1: 172.28.19.251(50139) <-> 172.28.19.252(80)
1360889333.7185 (0.0010) C>S
---------------------------------------------------------------
HEAD /something?bar=xyz&foo=abcdef HTTP/1.1
User-Agent: curl/7.15.5 (i686-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
Host: 172.28.19.252
Accept: */*
---------------------------------------------------------------
New TCP connection 2: 200.200.200.10(50139) <-> 200.200.200.101(80)
1360889333.7196 (0.0009) C>S
---------------------------------------------------------------
HEAD /something?bar=xyz&foo=abcdef HTTP/1.1
User-Agent: curl/7.15.5 (i686-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
Host: 172.28.19.252
Accept: */*
---------------------------------------------------------------
USER-ID
[root@ve10:Active] config ssldump -Aed -nni 0.0 port 80
New TCP connection 1: 172.28.19.251(50140) <-> 172.28.19.252(80)
1360889374.9256 (0.0011) C>S
---------------------------------------------------------------
HEAD /something?USER-ID=1111 HTTP/1.1
User-Agent: curl/7.15.5 (i686-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
Host: 172.28.19.252
Accept: */*
---------------------------------------------------------------
New TCP connection 2: 200.200.200.10(50140) <-> 200.200.200.111(80)
1360889374.9274 (0.0017) C>S
---------------------------------------------------------------
HEAD /something?USER-ID=1111 HTTP/1.1
User-Agent: curl/7.15.5 (i686-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
Host: 172.28.19.252
Accept: */*
---------------------------------------------------------------
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects