Forum Discussion
Arley_6164
Nimbostratus
Jun 29, 2009One Virtual Server on All Ports
I was trying to consolidade some of our big-ip deployments and came with an ideia for some websites to aggregate them on one single Virtual Server. For that matter I'd set up a VS listening on *all ports* and build my irule as follow:
if {[TCP::local_port] equals 80} {
switch -glob [string tolower [HTTP::host]] {
"foo.com"{ pool foo }
default {
discard
}
}
}
elseif {[TCP::local_port] equals 443} {
switch -glob [string tolower [HTTP::host]] {
"secure.foo.com"{ pool foo_secure }
default {
discard
}
}
}
else {
[HTTP::redirect "http://www.microsoft.com"]
}
Basically debugs shows nothing, it seems that the Virtual Server doesnt even comes up when *All Ports* option enabled, no traffic reaches the irule.
Any ideas?
Cheers,
Arley
4 Replies
- The_Bhattman
Nimbostratus
What is the EVENT are you using?
CB - hoolio
Cirrostratus
If you want to selectively decrypt SSL for some requests, you would need to add a client SSL profile to the virtual server and then disable it for requests which don't use SSL.
Also, you should take off the square braces around HTTP::redirect, as that would try to execute the return value of the redirect.
Here is an example for handling multiple ports/protocols on the same virtual server:
http://devcentral.f5.com/wiki/default.aspx/iRules/HttpHttpsSingleVirtualServer.html
Lastly, if you have any specific port virtual servers defined (like port 80 or 443), they would take precedence over the port 0 virtual server. So you would need to delete those before testing this iRule on a port 0 virtual server.
Aaron - Arley_6164
Nimbostratus
Posted By cmbhatt on 06/29/2009 11:07 AM
What is the EVENT are you using?
CB
when HTTP_REQUEST - The_Bhattman
Nimbostratus
Did you try when SERVER_CONNECTED
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