Forum Discussion
iRule redirect with URL masking and URI rewrite
- Aug 09, 2017
Hi,
You can't achieve what you are expecting without using iframes. But I strongly discourage you to use them for security reasons.
You can instead redirect to a relative path and then forward the request to the correct backend server :
`
when HTTP_REQUEST { if { [HTTP::host] contains "buyer.abc.com" and [HTTP::path] eq "/" } { HTTP::redirect "/apm/rest/MOBILITY/authService/1.0" return } if {[HTTP::host] contains "buyer.abc.com" and [HTTP::path] eq "/apm/rest/MOBILITY/authService/1.0"} { node myserver01 9001 return } }
`
Hi,
You can't achieve what you are expecting without using iframes. But I strongly discourage you to use them for security reasons.
You can instead redirect to a relative path and then forward the request to the correct backend server :
`
when HTTP_REQUEST {
if { [HTTP::host] contains "buyer.abc.com" and [HTTP::path] eq "/" } {
HTTP::redirect "/apm/rest/MOBILITY/authService/1.0"
return
}
if {[HTTP::host] contains "buyer.abc.com" and [HTTP::path] eq "/apm/rest/MOBILITY/authService/1.0"} {
node myserver01 9001
return
}
}
`
Redirecting the user mean that the browser will issue a request to the provided URL.
If the URL is absolute, the browser will issue a request to myserver01 on tcp port 9001.
If myserver01 resolve a virtual server IP, then the request will go through the Bigip.
otherwise, the request will be issued to the backend server without reaching the bigip.
You can also use the pool command instead of node.
Hope it help
Recent Discussions
Related Content
* 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