Forum Discussion
Eddie_27920
Nimbostratus
Feb 03, 2015iRule help please, newbie
Hi I have the existing iRule that works just fine with checking the host name. On the last elseif when looking for abc.gov host name I also want to look for https protocol to send it to a seperate pool using 443. Basically the logic would be if host contains host1.gov AND is port 443 then use pool abc_443 ELSE use abc.gov (which is a port redirect to 58080). Is this possible? I can't fiond the commands to do the AND situation. Thanks, Eddie
6 Replies
- shaggy
Nimbostratus
what port(s) does the associated virtual server(s) use? - Eddie_27920
Nimbostratus
... - StephanManthey
Nacreous
How about this?
if { ([string tolower [HTTP::host]] equals "swfm2.dev.mesaaz.gov") && ([TCP::local_port] == 443) } { pool swfm2_443 } else { HTTP::redirect http://swfm2.mesaaz.gov:58080/ } - shaggy
Nimbostratus
i ask because if the F5 virtual server is listening on port 80 (non-ssl), then you will either need to use a second virtual server to handle the SSL traffic, or the irule will also need to select a server-ssl profile when sending traffic to a pool of ssl servers/services - Eddie_27920
Nimbostratus
OK I get this error with the iRule suggested: - StephanManthey
Nacreous
There were wrong parentheses:
when HTTP_REQUEST { set host [string tolower [HTTP::host]] if { $host eq "solidwaste.dev.mesaaz.gov"} { pool solidwaste.dev.mesaaz.gov } elseif { $host contains "swfm1.dev.mesaaz.gov"} { pool swfm1.mesaaz.gov } elseif { ($host contains "swfm2.dev.mesaaz.gov") && ([TCP::local_port] == 443) } { pool swfm2.mesaaz.gov_443 } else { pool swfm2.mesaaz.gov } }
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