Forum Discussion
Matt_108113
Nimbostratus
Jul 15, 2009Using Irules to mimic apache Virtual hosts
I would like to use I rules to mimic Apache Virtual Hosts.
I have a web server that has a bunch of sites on it and instead of setting up virtual hosts on Apache I wanted to see if I could do this with Irules.
Basically when someone hits the site and requests http://webserver1.domain.com/SITE1 they would be redirected to.
http://SITE1.domain.com in the browser.
there are multiple sites and they are added all the time so if I could get something generic like.
when HTTP_REQUEST {
if { [HTTP::uri] contains "/SITE1" }{
HTTP::redirect http://site1.domain.com}
}
Is kind of the idea, but how to I make the F5 aware that site1 is on the webserver at http://webserver1.domain.com/SITE1?
The problem is I don't know syntactically what needs to be were to do this.
Any help would be appreciated.
11 Replies
Sort By
- JRahm
Admin
@bcallahan, yes you could do something like this:when HTTP_REQUEST { HTTP::header replace Host "www.apacheserver.com" HTTP::uri "/[getfield [domain [HTTP::host] 2] 1][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