Forum Discussion
Dynamic url redirection feasibility
In one of the BIG –IP integrated application need to redirect a dynamic url to other one.
Requirement description:
“”
Client require the call back API to FED bank endpoint in format : IP:port/udir/RespChkTxn/….. . Since we are using the IBM’s product we will have our url in format https://apiuatgwy.fedbank.com/fed/uat/udir/RespChkTxn/ . client at their end cannot append /fed/uat since this is uniform format across call banks. Hence kindly check if the url redirect may be possible before it reaches gateway.
Original url by npci example:
https://apiuatgwy.febbank.com/udir/RespChkTxn/1.0/urn:txnid:SIBJfYoPALjqHtdLbdDbLbp1YEQ7DZFV5LR
url to be redirected :
“”
- Whether it is possible to redirect/rewrite dynamic url’s in BiG-IP?
- Share the irule/redirect/rewrite etc. configuration for achieving the above requirement
Regards
Christy Thomas
Based on what you provided in your screenshot it should be the following.
when HTTP_REQUEST priority 500 { if { [HTTP::host] eq "apiuatgwy.fedbank.com" } { if { [HTTP::uri] starts_with "/udir" } { set URI [string map -nocase {"/udir" "/sib/uat/udir/"} [HTTP::uri]] HTTP::uri ${URI} } } }
Assuming that you don't really have to pay any mind to the piece following this path "/udir/RespChkTxn/1.0/urn" because the remainder is dynamic the following should work. If you wish to have to have another redirect other than 302 then you could use HTTP::respond with the appropriate HTTP status value.
when HTTP_REQUEST priority 500 { set URI [string tolower [HTTP::uri]] if { [HTTP::host] eq "apiuatgwy.fedbank.com" } { if { ${URI} starts_with "/udir/respchktxn/1.0/urn" } { HTTP::redirect "https://[HTTP::host]/fed/uat[HTTP::uri]" } } }
hi Paulius
Thanks for sharing the irule.
i will test the irule in BIG-IP with the application integrated and update
Hi Paulius
Unfortunately the irule that you have shared is not working. I have attached a picture that, the same scenario has worked in cloudflare, Requestig you to check the attachment and help on this.
thanks
Christy
Based on what you provided in your screenshot it should be the following.
when HTTP_REQUEST priority 500 { if { [HTTP::host] eq "apiuatgwy.fedbank.com" } { if { [HTTP::uri] starts_with "/udir" } { set URI [string map -nocase {"/udir" "/sib/uat/udir/"} [HTTP::uri]] HTTP::uri ${URI} } } }
- zamroni777Nacreous
is that callbak url parameter is part of client request parameter/body?
if yes, you need to modify the intended object.
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