Forum Discussion
URI and Host replace
hi ,
I need to do the following :
when user request : https://a.x.com/retail
F5 will change it to : http://b.x.com:9081/portal when forwarding the request to the pool-A, and will return https://a.x.com/retail with uri mask
when user request : https://a.x.com/corporate
F5 will change it to : http://b.x.com:9082/portal when forwarding the request to the pool-B , and will return https://a.x.com/retail with uri mask
- the server can accept b.x.com in the host header
-
two pools were configured , pool-A [member is b.x.com port 9081] , pool-B [member is b.x.com port 9082]
-
please can you help me to configure an iRule meeting my requirements .
thanks Yazan Khader
5 Replies
- Yazan_Khader
Nimbostratus
adding more details :
hi ,
I need to do the following :
when user request : https://a.x.com/retail F5 will change it to : http://b.x.com:9081/portal when forwarding the request to the pool-A, and will return https://a.x.com/retail with uri mask to the client
when user request : https://a.x.com/corporate F5 will change it to : http://b.x.com:9082/portal when forwarding the request to the pool-B , and will return https://a.x.com/retail with uri mask to the client ◾the server can accept b.x.com in the host header ◾ two pools were configured , pool-A [member is b.x.com port 9081] , pool-B [member is b.x.com port 9082]
◾ please can you help me to configure an iRule meeting my requirements .
thanks Yazan Khader
.
- Kevin_Stewart
Employee
Try this:
when HTTP_REQUEST { switch -glob [string tolower [HTTP::uri]] { "/retail*" { pool Pool-A HTTP::header replace Host "b.x.com:9081" HTTP::uri "/portal" } "/corporate*" { pool Pool-B HTTP::header replace Host "b.x.com:9082" HTTP::uri "/portal" } default { reject } } } - Yazan_Khader
Nimbostratus
thank you Kevin , this will work for the client request the server will respond back to the client with x.b.com:port and uri /portal/* which need to be mapped back to host a.x.com and uri [/retail/* or /corporate/*] based on the original request .
also , on the user's browser address bar , I need to hide the mapped uri path after /retail and /corporate [/retail/xxxxx] and [/corporate/xxxxx]
please can you help me with this
- Kevin_Stewart
Employee
Well, assuming the references to "/retail" and "/corporate" are going to be within the payload (ie. page object references), I might suggest a ProxyPass iRule implementation, or the rewrite profile if your on 11.4.
- Yazan_Khader
Nimbostratus
thanks Kevin ,
I tried the ProxyPass irule with the following data group settings but didn't work:
"a.x.com" := "b.x.com", "a.x.com/retail" := "b.x.com:9081/iportal pool-A", "a.x.com/corporate" := "b.x.com:9082/iportal pool-B", "https://" :- "http://" "/" := "b.x.com/",
i noticed that the depending on the previous data-group values . the client browser is redirected to a.x.com/iportal then I got http-error-500
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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