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

Check old path using ACL after replacing it

$
0
0

@Mike-Code wrote:

I would like to do URL rewrite which looks like not so easy deal here.

Say I want to replace url’s with mysite.com/boom/23/bam to mysite.com/bam/23/boom

Let’s have following config

acl OLD_PATH path_reg -i /boom/\d+/bam
reqrep ^([^\ :]*) /boom/(\d+)/bam \1 /bam/\2\boom
redirect code 301 prefix / drop-query if OLD_PATH

It looks fine, but the redirect won’t happen because the path has been already replaced, so I can’t use OLD_PATH acl anymore.

Yet, if I create new ACL with the new path (/bam/_/boom) then I’ll be throwing 301 at all requests, not just the ones that required replacing.

How can I have ACL run against the old request line?

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>