Forum Discussion
Abe_11636
Sep 14, 2011Cirrus
simple irule not forwarding
this is my irule: (for a vip on 443) when HTTP_REQUEST { if { [HTTP::host] eq "http://aira.coxnet.cox.net"} { HTTP::redirect "https://aira.coxnet.cox.net/airnetProp...
richard_77048
Sep 14, 2011Nimbostratus
I see two things with your rule.
First, is that [HTTP::host] is never going to be a full URL. The host portion of the request would be "aira.coxnet.cox.net". Your rule will never match an HTTP host because you will never get one that looks like the one in your rule.
Second, you say this is rule is on an HTTPS vip. Any requests going to this vip are going to be of the form, "https://aira.coxnet.cox.net/???". It looks like what you are trying to do is redirect HTTP requests to HTTPS. If you want all traffic to go over HTTPS, you could configure a vip listening on port 80 and add a rule that redirects all requests to HTTPS. It might look something like this:
when HTTP_REQUEST {
HTTP::redirect "https://[HTTP::host][HTTP::uri]"
}
You could always check the HTTP host on that if you wanted which would make it look like this:
when HTTP_REQUEST {
if {[HTTP::host] equals "aira.coxnet.cox.net" } {
HTTP::redirect "https://[HTTP::host][HTTP::uri]"
}
}
Richard
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