On Mon, Jul 08, 2019 at 02:36:13PM +0200, Tim Düsterhus wrote:
> Artur.
> 
> Am 08.07.19 um 14:25 schrieb Artur:
> > Hello,
> > 
> > Could you please suggest how to rewrite following rules written with
> > 'regrep' with 'http-request replace-uri' :
> > 
> > frontend www
> >  reqrep ^([^\ ]*)\ /p3/js/(.*) \1\ /p3/js-min/\2
> > 
> > The idea is to rewrite something similar to "GET /p3/js/file.js
> > HTTP/1.1" with  "GET /p3/js-min/file.js HTTP/1.1".
> > 
> 
> You basically can copy over the "second half" of your rule and adjust
> the numbers referencing the capturing groups:
> 
> http-request replace-uri /p3/js/(.*) /p3/js-min/\1
> 
> Consider either adding a `^` at the start to only match URLs starting
> with /p3/ or add an `if` that ensures only URLs starting with /p3/ are
> modified.

Maybe we should add such examples in the reqrep doc ? Or maybe we
should wait for 1 or 2 other ones to complement this one ?

Willy

Reply via email to