Quantcast
Channel: HAProxy community - Latest topics
Viewing all articles
Browse latest Browse all 4718

Achieving http redirection using regex matching

$
0
0

@prasanna wrote:

Hi,
I just want to know if there is a possibility to achieve the following in haproxy.
I have a few routes that I have stored in a map file.
Based on the regex matching , if it matches a specific route I want to redirect to another route.
Example::
route_map.map
So these numbers can be any numbers…so basically match a regex, get the id, and give the corresponding output with the id.
/abc/tickets/1 —> /a/tickets/1
/def/users/20 —> /a/users/20

I would like to achieve this.Tried using map_regm function.But could not find any example.

http-request redirect code 302 location %[path,map_regm(/route_map.map)]

Thankyou.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4718

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>