Forum Discussion
F5Hopper_28651
Nimbostratus
Dec 17, 2012dev servers irule
hey guys,
not sure how to do this one, I have
dev01.www.etc.com, dev02.www.etc.com, through dev20.www.etc.com
I also have
dev01.app.etc.com through dev20.app.etc.com.
...
What_Lies_Bene1
Cirrostratus
Dec 17, 2012OK, I'm no expert and haven't used findstr much or had to use variables with redirect but here's my first attempt. The idea is to check for a request containing www, pull out the server number and redirect to the correct app domain/server;
when HTTP_REQUEST {
if { [string tolower [HTTP::host]] contains ".www." } {
set devserverid [findstr [HTTP::host] "dev" 0 "."]
log local0. "Found $devserverid in HTTP host"
HTTP::redirect "http://dev" + "$devsererid" + ".app.etc.com[[http:uri]]"
}
}
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