Forum Discussion
pr
Nimbostratus
Mar 28, 2017Need suggestion on and operation
HI All,
I am looking to achieve for below url if webservices string comes in http::uri & end with .asmx keyword then virtual server will send the traffic to pool otherwise it will redirect to h...
Stanislas_Piro2
Cumulonimbus
Mar 28, 2017Hi,
did you assign this irule to HTTP VS only (if assigned to HTTPS VS, it will loop)
The irule seems right (why using HTTP::uri for the start, and HTTP::path for the end... use HTTP::path for both start and end)
if you want to allow uppercase, convert HTTP::path to lower case.
when HTTP_REQUEST {
set path [string tolower [HTTP::path]]
if {([HTTP::host] equals "powerup-qa.directenergy.com") and ($path starts_with "/webservices/") and ($path ends_with ".asmx")} {
pool Powerup-QA_pool_http
} else {
HTTP::redirect https://[HTTP::host][HTTP::uri]
}
}
Or if you want to manage only host powerup-qa.directenergy.com:
when HTTP_REQUEST {
set path [string tolower [HTTP::path]]
if {([HTTP::host] equals "powerup-qa.directenergy.com")} {
if {($path starts_with "/webservices/") and ($path ends_with ".asmx")} {
pool Powerup-QA_pool_http
} else {
HTTP::redirect https://[HTTP::host][HTTP::uri]
}
} else {
Host header value not managed by the irule
}
}
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
