Forum Discussion
Sean_Phillips_1
Nimbostratus
May 17, 2007Routing specific pages through port 443??
I am trying to route all login pages through port 443 but everything else through port 80. Will this work?
when HTTP_REQUEST {
if { ([HTTP::uri] contains "Login.asp") or ([HTTP::uri] contains "Login.jsp") }{
HTTP::redirect https://[getfield [HTTP::host] ":" 1][HTTP::uri]
}
else
{
HTTP::redirect http://[getfield [HTTP::host] ":" 1][HTTP::uri]
}
}
Txs
1 Reply
- hoolio
Cirrostratus
I assume you're applying this rule to an HTTP virtual server and only want to redirect the login requests to HTTPS (leaving the rest of the requests to be answered by the HTTP virtual server). If so, the first redirect for Login.asp/Login.jsp looks correct. However, it shouldn't be necessary to redirect the requests which don't match the Login pages. You should be able to just remove the else portion:when HTTP_REQUEST { if { ([HTTP::uri] contains "Login.asp") or ([HTTP::uri] contains "Login.jsp") }{ HTTP::redirect https://[getfield [HTTP::host] ":" 1][HTTP::uri] } }
As long as you have a default pool configured on the virtual server, all non-Login requests will be sent to that pool
If you're unsure of how the traffic is being parsed, you can add logging statements to the rule:
log local0. "client: [IP::client_addr] requested URI: [HTTP::uri]"
Aaron
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
