Forum Discussion
ShakN_167332
Nimbostratus
Aug 20, 2014Need help in Irule redirection for multiple sites.
in our setup we have sites which are accessed by internal users as well as internet users via http and https. so we have created 4 VS (2 internal VS, one for http and one for https for internal users...
nitass_89166
Noctilucent
Aug 24, 2014e.g.
config
root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm virtual bar
ltm virtual bar {
destination 172.28.24.10:80
ip-protocol tcp
mask 255.255.255.255
pool foo
profiles {
http { }
tcp { }
}
rules {
qux
}
source 0.0.0.0/0
source-address-translation {
type automap
}
vs-index 70
}
root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm data-group internal redirect_class
ltm data-group internal redirect_class {
records {
asites.abc.com/xyz/budget {
data http://asites.internet.abc.com/sites/budget
}
asites.abc.com/xyz/finance {
data http://asites.internet.abc.com/sites/finance
}
}
type string
}
root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm rule qux
ltm rule qux {
when HTTP_REQUEST {
log local0. "\[HTTP::host\] is [HTTP::host]"
log local0. "\[HTTP::uri\] is [HTTP::uri]"
log local0. "\[class match -- [HTTP::host][HTTP::uri] equals redirect_class\] is \
[class match -- [HTTP::host][HTTP::uri] equals redirect_class]"
if { [class match -- [HTTP::host][HTTP::uri] equals redirect_class] } {
log local0. "\[class match -value [HTTP::host][HTTP::uri] equals redirect_class\] is \
[class match -value [HTTP::host][HTTP::uri] equals redirect_class]"
HTTP::redirect [class match -value [HTTP::host][HTTP::uri] equals redirect_class]
}
}
}
test
[root@centos1 ~] curl -I http://asites.abc.com/xyz/finance
HTTP/1.0 302 Found
Location: http://asites.internet.abc.com/sites/finance
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
[root@centos1 ~] curl -I http://asites.abc.com/xyz/budget
HTTP/1.0 302 Found
Location: http://asites.internet.abc.com/sites/budget
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
/var/log/ltm
[root@ve11a:Active:In Sync] config tail -f /var/log/ltm
Aug 24 06:33:34 ve11a info tmm[29362]: Rule /Common/qux : [HTTP::host] is asites.abc.com
Aug 24 06:33:34 ve11a info tmm[29362]: Rule /Common/qux : [HTTP::uri] is /xyz/finance
Aug 24 06:33:34 ve11a info tmm[29362]: Rule /Common/qux : [class match -- asites.abc.com/xyz/finance equals redirect_class] is 1
Aug 24 06:33:34 ve11a info tmm[29362]: Rule /Common/qux : [class match -value asites.abc.com/xyz/finance equals redirect_class] is http://asites.internet.abc.com/sites/finance
Aug 24 06:33:46 ve11a info tmm1[29362]: Rule /Common/qux : [HTTP::host] is asites.abc.com
Aug 24 06:33:46 ve11a info tmm1[29362]: Rule /Common/qux : [HTTP::uri] is /xyz/budget
Aug 24 06:33:46 ve11a info tmm1[29362]: Rule /Common/qux : [class match -- asites.abc.com/xyz/budget equals redirect_class] is 1
Aug 24 06:33:46 ve11a info tmm1[29362]: Rule /Common/qux : [class match -value asites.abc.com/xyz/budget equals redirect_class] is http://asites.internet.abc.com/sites/budget
ShakN_167332
Nimbostratus
Aug 24, 2014am trying to create a data group in my device which is running 10.2.4 build 817 can you please help help how to configure in this. of else cli cmd for tmsh.
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