Forum Discussion
ProxyPass URI Rewrite with wildcard matching
We are loooking to do some URI rewrites with the Proxypass irule that acheive the following:
- ->
- ->
- ->
- ->
so the unique part of the URI could be evergrowing in the order of thousands and will be dynamic hence a rule in the datagroup for each possible match is not suitable.
clients do not support redirects so proxy seems like the only choice.
datagroup strings like the following don't work either "hostA/pathA/*/" := "hostB/pathB/ Pool_B"
Any ideas ??
7 Replies
- R_Marc
Nimbostratus
What you have described is just a regex match and replace. Doesn't really require a data-group unless the pattern doesn't persist or is not something you can match on. Kinda looks like a one liner. Perhaps data groups could come into play if you had a host[a-x] mapping to host[A-X] and likewise with paths but still a regex should fill the gaps.
- Yann_Desmarest_
Nacreous
Hi,
Below an irule that may help you to start :
when HTTP_REQUEST { if { [HTTP::host] eq "hostA" } { can set hostname in v11.5+ otherwise, should use HTTP::header replace Host "hostB" HTTP::host "hostB" } Rewrite uri HTTP::uri "/pathB/[URI::basename]" }- Yann_Desmarest_
Nacreous
For the response rewrite, you will need a stream profile - jason_millan_40
Nimbostratus
Gathering from the responses that ProxyPass iRULE doesn't support wildcarding so I am going to have to get dirty. I might borrow from ProxyPass how they do the streaming. Will reply back with updates and share the results!
Hi,
Below an irule that may help you to start :
when HTTP_REQUEST { if { [HTTP::host] eq "hostA" } { can set hostname in v11.5+ otherwise, should use HTTP::header replace Host "hostB" HTTP::host "hostB" } Rewrite uri HTTP::uri "/pathB/[URI::basename]" }- For the response rewrite, you will need a stream profile
- jason_millan_40
Nimbostratus
Gathering from the responses that ProxyPass iRULE doesn't support wildcarding so I am going to have to get dirty. I might borrow from ProxyPass how they do the streaming. Will reply back with updates and share the results!
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