Forum Discussion
Banny_Lau_10257
Nimbostratus
Jun 24, 2005How to write irule to form the function of Virtual Host?
Hi !
Could irule form the function of Virtual Host like Apache? How to do it? Could you have simple example for it ? Thanks a lot !
Banny
4 Replies
- Brian_Gupta_115
Nimbostratus
This should get you started.
when HTTP_REQUEST {
set my_vhost [string tolower [HTTP::host]]
if { $my_vhost == "www.shoe.com" } {
pool shoepool
} elseif { $my_vhost == "blog.shoe.com" } {
pool blogpool
} else {
reject
}
}
-Brian
P.S. - Let us know what you are trying to do - Thomas_Uczekaj_
Nimbostratus
This works good if there is no rewrite of the URL. How would you do that?
ie:
Apache Proxy
....
ProxyPass / http://junk.domain.com/newsite
ProxyPassReverse / http://junk.domain.com/newsite
thanks for any help
Tom. - Colin_Walker_12Historic F5 AccountI'm not sure I understand your question. What exactly are you trying to do with the iRule?
Colin - Thomas_Uczekaj_
Nimbostratus
I have a reverse Apache Proxy. The ProxyPass and ProxyPassReverse statements will either redirect or rewrite (not sure which) the incoming http request.
I want my v9.x BigIP to do this with and IRULE but there is so much more granularity, I was curious if someone understood specifically the conversion specifics.
For example: if the http comes in as http://junk.domain.com/test
the apache proxy does a ProxyPass /test http://newdest.domain.com/otherdir
What would be the equivalent from the IRULE? Such questions as:
1) would I use [HTTP::uri] eq "/test"
2) would I use HTTP::redirect http://newdest.domain.com/otherdir"
Would the IRULE catch something like //junk.domian.com/test/anotherdir and rewrite it properly
Is starts_with going to proxy "/testing" or just drop it?
Should I use redirect or another directive?
Does this make more sense?
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
