Forum Discussion
craig_lee10_177
Nimbostratus
Oct 02, 2012Need a pointer
Hi I need some help with an irule that I am banging my head with. Basically I need to keep the uri intact from a client point of view and strip out the /development before it gets sent to the backend...
nitass
Employee
Oct 02, 2012e.g.
[root@ve10:Active] config b virtual bar list
virtual bar {
snat automap
pool foo
destination 172.28.19.79:80
ip protocol 6
rules myrule
profiles {
http {}
tcp {}
}
}
[root@ve10:Active] config b pool foo list
pool foo {
members 200.200.200.101:80 {}
}
[root@ve10:Active] config b rule myrule list
rule myrule {
when HTTP_REQUEST {
set host [HTTP::host]
HTTP::uri [string map {/development ""} [HTTP::uri]]
}
when HTTP_RESPONSE {
if {[HTTP::is_redirect]} {
HTTP::header replace Location [string map "http://${host}/ http://${host}/development/" [HTTP::header Location]]
}
}
}
[root@ve10:Active] config ssldump -Aed -nni 0.0 port 80
New TCP connection 1: 172.28.19.251(49146) <-> 172.28.19.79(80)
1349186691.3431 (0.0009) C>S
---------------------------------------------------------------
HEAD /development/something 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
Accept: */*
Host: www.abc.com
---------------------------------------------------------------
New TCP connection 2: 200.200.200.10(49146) <-> 200.200.200.101(80)
1349186691.3441 (0.0009) C>S
---------------------------------------------------------------
HEAD /something 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
Accept: */*
Host: www.abc.com
---------------------------------------------------------------
1349186691.3451 (0.0009) S>C
---------------------------------------------------------------
HTTP/1.1 302 Found
Date: Tue, 02 Oct 2012 14:21:04 GMT
Server: Apache/2.2.3 (CentOS)
Location: http://www.abc.com/online/TestLogin.aspx
Connection: close
Content-Type: text/html; charset=iso-8859-1
---------------------------------------------------------------
1349186691.3451 (0.0020) S>C
---------------------------------------------------------------
HTTP/1.1 302 Found
Date: Tue, 02 Oct 2012 14:21:04 GMT
Server: Apache/2.2.3 (CentOS)
Location: http://www.abc.com/development/online/TestLogin.aspx
Connection: close
Content-Type: text/html; charset=iso-8859-1
---------------------------------------------------------------
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