Forum Discussion
Ahmad_03_151082
Nimbostratus
Mar 24, 2015Http to Https except specific URLs
Dears,
I am facing an issue with iRules i have created below iRule
when HTTP_REQUEST {
HTTP::redirect https://[getfield [HTTP::host] ":"][HTTP::uri]
...
Hannes_Rapp_162
Nacreous
Apr 08, 2015Hi Ahmad, I've modified the iRule a bit, this should work across all v11.x versions.
when HTTP_REQUEST {
if { ([HTTP::host] equals "oservices.bahrain.bh") && ( [string tolower [HTTP::path]] equals "/pubportal/insurancedetailsuploadws/services/insuranceuploadimpl" ) }{
log local0. "Client: [IP::client_addr]: Requested [HTTP::host][HTTP::uri]. HTTPS redirect omitted"
} else {
HTTP::respond 302 location "https://[HTTP::host][HTTP::uri]"
log local0. "Client: [IP::client_addr]: Requested [HTTP::host][HTTP::uri]. Redirected to HTTPS"
TCP::close
}
}
Test with logging enabled: "curl -vI oservices.bahrain.bh/pubportal/InsuranceDetailsUploadWS/services/InsuranceUploadImpl"
Apr 8 12:26:18 bigip1 info tmm1[12385]: Rule /Common/asd : Client: xx.xx.xx.xx: Requested oservices.bahrain.bh/pubportal/InsuranceDetailsUploadWS/services/InsuranceUploadImpl. HTTPS redirect omitted
- Hannes_Rapp_162Apr 08, 2015
Nacreous
Have taken a look at the response header - it appears that something in between modifies the request path and the "/pubportal" substring is eaten up, before the request is even routed to F5 BigIP. Do you have another proxy in between your desktop(test machine) and the F5 BigIP? < location: https://oservices.bahrain.bh/InsuranceDetailsUploadWS/services/InsuranceUploadImpl As a workaround in F5, you can further modify the iRule and replace the conditional IF statement with: if { ([HTTP::host] equals "oservices.bahrain.bh") && ( [string tolower [HTTP::path]] contains "/insurancedetailsuploadws/services/insuranceuploadimpl" ) }{ - nitassApr 12, 2015
Employee
doesn't it already work? i do see the response is not redirection.
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