Re: Understanding haproxy's regex

2023-11-17 Thread Willy Tarreau
ually I'm used the write multiple patterns as \(pattern1\)\(pattern2\). So > is it a different regex syntax? > > The other question - since I don't understand the above statement at all - > what does it exactly do? > > With 2.4 the corresponding line was (instead of the replace-h

Re: Understanding haproxy's regex

2023-11-17 Thread Aleksandar Lazic
m used the write multiple patterns as \(pattern1\)\(pattern2\). So is it a different regex syntax? The regex of HAProxy is explained here. http://docs.haproxy.org/2.8/configuration.html#7.1.4 In addition could be this part interesting for you. Quoting and escaping http://docs.haproxy.o

Understanding haproxy's regex

2023-11-17 Thread Christoph Kukulies
I have the following line in my config: backend website http-request replace-header Destination ^([^\ :]*)\ /(.*) \1\ /opencms/\2 server www.mydomain.org 127.0.0.1:8080 Actually I'm used the write multiple patterns as \(pattern1\)\(pattern2\). So is it a different regex syntax

Re: [PATCH] BUG/MINOR: checks: update pgsql regex on auth packet

2022-10-04 Thread Christopher Faulet
payload length may vary since the method is sent in plaintext. In order to allow this, the regex now matches any payload length. This partially fixes Github issue #1508 since user authentication is still broken but should restore pre-2.2 behavior. This should be backported up to 2.2. Signed-off

Re: [PATCH] BUG/MINOR: checks: update pgsql regex on auth packet

2022-09-30 Thread Christopher Faulet
payload length may vary since the method is sent in plaintext. In order to allow this, the regex now matches any payload length. This partially fixes Github issue #1508 since user authentication is still broken but should restore pre-2.2 behavior. This should be backported up to 2.2. Thanks

[PATCH] BUG/MINOR: checks: update pgsql regex on auth packet

2022-09-26 Thread Fatih Acar
is sent in plaintext. In order to allow this, the regex now matches any payload length. This partially fixes Github issue #1508 since user authentication is still broken but should restore pre-2.2 behavior. This should be backported up to 2.2. Signed-off-by: Fatih Acar --- reg-tests/checks/pgsql

Re: [PATCH]: regex: PCRE2 optimisation with JIT

2020-08-13 Thread Willy TARREAU
On Thu, Aug 13, 2020 at 06:17:15PM +0100, David CARLIER wrote: > To be honest not huge improvement but relatively constant has it is > set once per regex compilation. Perfect, thanks, now merged. Willy

Re: [PATCH]: regex: PCRE2 optimisation with JIT

2020-08-13 Thread David CARLIER
To be honest not huge improvement but relatively constant has it is set once per regex compilation. On Thu, 13 Aug 2020 at 17:54, Willy TARREAU wrote: > > On Thu, Aug 13, 2020 at 05:30:49PM +0100, David CARLIER wrote: > > In fact the jit match does less check than the normal ma

Re: [PATCH]: regex: PCRE2 optimisation with JIT

2020-08-13 Thread Willy TARREAU
On Thu, Aug 13, 2020 at 05:30:49PM +0100, David CARLIER wrote: > In fact the jit match does less check than the normal match and fits > better when the regex code had been compiled with JIT. However the > classic match call still works with JIT only it does more checks. OK! did you ob

Re: [PATCH]: regex: PCRE2 optimisation with JIT

2020-08-13 Thread David CARLIER
In fact the jit match does less check than the normal match and fits better when the regex code had been compiled with JIT. However the classic match call still works with JIT only it does more checks. Regards. On Thu, 13 Aug 2020 at 17:22, Willy TARREAU wrote: > > Hi David, > > On

Re: [PATCH]: regex: PCRE2 optimisation with JIT

2020-08-13 Thread Willy TARREAU
Hi David, On Thu, Aug 13, 2020 at 03:00:28PM +0100, David CARLIER wrote: > Subject: [PATCH] CLEANUP/MEDIUM: regex: PCRE2 use JIT match when JIT > optimisation occured. > > When a regex had been succesfully compiled by the JIT pass, it is better > to use the related match, tha

[PATCH]: regex: PCRE2 optimisation with JIT

2020-08-13 Thread David CARLIER
Hi, here a little update proposal for the PCRE2 support. Hope it s useful. Cheers. From f52735b133fff5c195a52a54623b556ecb58e22d Mon Sep 17 00:00:00 2001 From: David Carlier Date: Thu, 13 Aug 2020 14:53:41 +0100 Subject: [PATCH] CLEANUP/MEDIUM: regex: PCRE2 use JIT match when JIT optimisation

How can I replace multiple regex matches in Cookie header?

2019-05-18 Thread Cal Brotto
all the instances of foo*, just the first one.  (Maybe I didn’t give the correct regex)     - Using regsub() with set-header.  It can’t deal with commas.   - I thought of url-encoding the header, then using regsub(), and then url-decoding it back using set-var variables, but there’s no url_enc

Re: Automatic Redirect transformations using regex?

2019-01-22 Thread Bruno Henc
Hello Joao Guimaraes, The following lines should accomplish what you described in your email:     acl is_main_site hdr(Host) -i www.mysite.com mysite.com     http-request set-var(req.scheme) str(https) if { ssl_fc }     http-request set-var(req.scheme) str(http) if !{ ssl_fc }    

Re: Automatic Redirect transformations using regex?

2019-01-22 Thread Aleksandar Lazic
Am 21.01.2019 um 23:40 schrieb Joao Guimaraes: > Hi Haproxy team! > > I've been trying to figure out how to perform automatic redirects based on > source URL transformations.  > > *Basically I need the following redirect: * > > mysite.*abc* redirected to *abc*.mysite.com . Maybe you can

Automatic Redirect transformations using regex?

2019-01-21 Thread Joao Guimaraes
Hi Haproxy team! I've been trying to figure out how to perform automatic redirects based on source URL transformations. *Basically I need the following redirect: * mysite.*abc* redirected to *abc*.mysite.com. Note that mysite.abc is not fixed, must apply to whatever abc wants to be. *Other

[PATCH 2/4] REGTEST: Be less Linux specific with a syslog regex.

2018-12-20 Thread flecaille
From: Frédéric Lécaille This patch makes at least this test pass on FreeBSD systems. The regex to be matched with syslog message was too much Linux specific. --- reg-tests/checks/s3.vtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reg-tests/checks/s3.vtc b/reg

[PATCH] CLEANUP: Fix typos in the regex subsystem

2018-11-15 Thread Joseph Herlant
Hi, This patch fixes typos in the code comment of the regex subsystem. Thanks, Joseph From 6944830de98bf005672546f113e3bf48537f277d Mon Sep 17 00:00:00 2001 From: Joseph Herlant Date: Thu, 15 Nov 2018 14:46:29 -0800 Subject: [PATCH] CLEANUP: Fix typos in the regex subsystem Fix typos

How to redirect with RegEx by using a found pattern in destination

2018-07-17 Thread Jürgen Haas
][a-z]).pdf \1\ /\2/404 if needsredirect !ischina redirect scheme https code 301 if needsredirect !ischina ``` The first 2 lines determine if we have to redirect which is the case if `needsredirect` is TRUE and `ischina` is FALSE. The third line does the regex on all headers and the fourth

Re: [PATCH]: using custom allocators into regex.

2017-07-21 Thread David CARLIER
After discussion with Willy I finally drop this change. Kind regards. On 21 July 2017 at 08:23, Willy Tarreau wrote: > On Fri, Jul 21, 2017 at 08:17:14AM +0100, David CARLIER wrote: > > Hi Willy, fair points. > > I don't understand, this the patch still uses MALLOC/FREE. > > Willy

Re: [PATCH]: using custom allocators into regex.

2017-07-21 Thread Willy Tarreau
On Fri, Jul 21, 2017 at 08:17:14AM +0100, David CARLIER wrote: > Hi Willy, fair points. I don't understand, this the patch still uses MALLOC/FREE. Willy

Re: [PATCH]: using custom allocators into regex.

2017-07-21 Thread David CARLIER
it;a=blob;f=src/memory.c;hb=HEAD#l198 > > There wouldn't be any benefit in doing this because our pools are fixed > size and are not compatible with a malloc() call by definition. Also, > pcre will call malloc() while compiling the regex, which is normally > not done at run time so there's

Re: [PATCH]: using custom allocators into regex.

2017-07-21 Thread Willy Tarreau
y definition. Also, pcre will call malloc() while compiling the regex, which is normally not done at run time so there's no benefit in trying to optimize for performance during this stage. However I agree that instrumenting a malloc() call is sometimes quite useful. Willy

Re: [PATCH]: using custom allocators into regex.

2017-07-21 Thread Aleksandar Lazic
Hi Willy Tarreau, Willy Tarreau wrote on 21.07.2017: > Hi David, > On Fri, Jul 21, 2017 at 07:36:37AM +0100, David CARLIER wrote: >> Hi all, >> >> hopefully it will be revealed useful, in this patch, we re trying to use >> the MALLOC/FREE macros since pcre* libraries are capable of overriding

Re: [PATCH]: using custom allocators into regex.

2017-07-21 Thread Willy Tarreau
Hi David, On Fri, Jul 21, 2017 at 07:36:37AM +0100, David CARLIER wrote: > Hi all, > > hopefully it will be revealed useful, in this patch, we re trying to use > the MALLOC/FREE macros since pcre* libraries are capable of overriding > internally memory management. Given that the MALLOC and FREE

[PATCH]: using custom allocators into regex.

2017-07-21 Thread David CARLIER
vne...@gmail.com> Date: Fri, 21 Jul 2017 07:26:38 +0100 Subject: [PATCH] MINOR: regex: using allocators macros Only pools use it at the moment, but since pcre (via its global pcre_malloc/pcre_free) and pcre2 (via contexts) can override memory management functions as well, we use here this possi

Re: [PATCH] MEDIUM : regex : draft of pcre2 support

2016-12-28 Thread David CARLIER
Hi Willy looks good to me thanks. On 28 December 2016 at 11:54, Willy Tarreau wrote: > Hi David, > > On Tue, Nov 22, 2016 at 11:11:09AM +0100, Willy TARREAU wrote: >> Thanks, your patch looks pretty clean so I'm keeping it for 1.8. > > So I've merged it now. I had to slightly adapt

Re: [PATCH] MEDIUM : regex : draft of pcre2 support

2016-12-28 Thread Willy Tarreau
Hi David, On Tue, Nov 22, 2016 at 11:11:09AM +0100, Willy TARREAU wrote: > Thanks, your patch looks pretty clean so I'm keeping it for 1.8. So I've merged it now. I had to slightly adapt the changes to regex.c to report the option in "-vv" since I made some changes in this area recently, but

Re: [PATCH] MEDIUM : regex : draft of pcre2 support

2016-11-22 Thread David CARLIER
I admit I did not spend time on this part, especially I did most of the development on OpenBSD where pcre2 is compiled without jit support (due to sljit W^X "policy violation", I believe a couple of security oriented linux distros do the same ...), plus couple of quick tests on ubuntu. Small

Re: [PATCH] MEDIUM : regex : draft of pcre2 support

2016-11-22 Thread Willy TARREAU
Hi David, On Mon, Nov 21, 2016 at 09:42:10PM +, David CARLIER wrote: > Hi, > > this patch attempts to bring pcre2 support to address the fact that pcre2 > is installed more and more over pcre due to its security flaws. If > accepted, it will be for 1.8, but I think somehow this is the good

[PATCH] MEDIUM : regex : draft of pcre2 support

2016-11-21 Thread David CARLIER
21:25:58 + Subject: [PATCH] MEDIUM: regex: pcre2 support this adds a support of the newest pcre2 library, more secure than its older sibling in a cost of a more complex API. It works pretty similarly to pcre's part to keep the overall change smooth, except : - we define the string class sup

Re: Haproxy 1.6.9 failed to compile regex

2016-10-28 Thread Lukas Tribus
Hello, Am 28.10.2016 um 01:03 schrieb Willy Tarreau: For the record: this has been fixed; and I also implemented the correct "Built with PCRE" information. Haproxy 1.6.10 will contain those fixes. ~/haproxy-1.6$ git log --oneline v1.6.9.. | grep PCRE dcdd2ae MINOR: show Built with PCRE

Re: Haproxy 1.6.9 failed to compile regex

2016-10-27 Thread Willy Tarreau
On Thu, Oct 27, 2016 at 05:43:38PM +0200, Lukas Tribus wrote: > Hello, > > > Am 08.09.2016 um 17:48 schrieb Lukas Tribus: > > > > > Means that haproxy -vv reported "Built with PCRE version" version > > > wrong previously. That confused me. > > > > This returns the output of pcre_version() and

Re: Haproxy 1.6.9 failed to compile regex

2016-10-27 Thread Lukas Tribus
Hello, Am 08.09.2016 um 17:48 schrieb Lukas Tribus: Means that haproxy -vv reported "Built with PCRE version" version wrong previously. That confused me. This returns the output of pcre_version() and yes, the text should be renamed to "Running with PCRE version", because the runtime

Regex text in response body

2016-09-11 Thread Antonio Cassidy
I would like to replaced some offsite links within the response body. I'm trying to use: rspirep findme REPLACED Within the backend deceleration but it doesnt seem to firing, most of the examples i have seen seems to be for heads and not body text. Is this possible? thanks

Re: Haproxy 1.6.9 failed to compile regex

2016-09-08 Thread Lukas Tribus
Hello Veiko, Am 08.09.2016 um 13:11 schrieb Veiko Kukk: Yes, turned out, build box had newer pcre installed (7 vs 8 major version). Compiling pcre statically solved that error/problem. Good to hear. If you link against a shared library, you will have to make sure they match in major

Re: Haproxy 1.6.9 failed to compile regex

2016-09-07 Thread Vincent Bernat
❦ 7 septembre 2016 16:42 CEST, Veiko Kukk  : >> I tried to upgrade from 1.6.8 to 1.6.9, but found strange errors printed >> by haproxy 1.6.9. Any ideas, why? > > Another strange issue is that 1.6.9 shows: > Running on OpenSSL version : OpenSSL 1.0.0-fips 29 Mar 2010 > >

Re: Haproxy 1.6.9 failed to compile regex

2016-09-07 Thread Lukas Tribus
Am 07.09.2016 um 16:42 schrieb Veiko Kukk: On 07/09/16 14:37, Veiko Kukk wrote: I tried to upgrade from 1.6.8 to 1.6.9, but found strange errors printed by haproxy 1.6.9. Any ideas, why? Another strange issue is that 1.6.9 shows: Running on OpenSSL version : OpenSSL 1.0.0-fips 29 Mar 2010

Re: Haproxy 1.6.9 failed to compile regex

2016-09-07 Thread Veiko Kukk
On 07/09/16 14:37, Veiko Kukk wrote: I tried to upgrade from 1.6.8 to 1.6.9, but found strange errors printed by haproxy 1.6.9. Any ideas, why? Another strange issue is that 1.6.9 shows: Running on OpenSSL version : OpenSSL 1.0.0-fips 29 Mar 2010 System does have openssl 1.0.1e-48.el6_8.1

Haproxy 1.6.9 failed to compile regex

2016-09-07 Thread Veiko Kukk
Hi, I tried to upgrade from 1.6.8 to 1.6.9, but found strange errors printed by haproxy 1.6.9. Any ideas, why? [ALERT] 250/112901 (12026) : parsing [/etc/haproxy/haproxy.cfg:57] : 'reqirep' : regular expression '^([^ :]*) /(.*)' : failed to compile regex '^([^ :]*) /(.*)' (error=unknown

Re: Does haproxy use regex for balance url_param lookup?

2016-06-26 Thread Chad Lavoie
Greetings, On 6/26/16 7:40 AM, k simon wrote: > Hi, lists, >I noticed that haproxy 1.6.5 hog the cpu periodiclly on FreeBSD 10 > with 800K-1M syscalls. I change the balance algo to "uri" and delete all > the regular expressions can work around it. There maybe some bug with > PCRE on

Does haproxy use regex for balance url_param lookup?

2016-06-26 Thread k simon
Hi, lists, I noticed that haproxy 1.6.5 hog the cpu periodiclly on FreeBSD 10 with 800K-1M syscalls. I change the balance algo to "uri" and delete all the regular expressions can work around it. There maybe some bug with PCRE on FreeBSD or some bug in haproxy, but I can't confirm it. And

Re: Use regex for backend selection

2016-06-22 Thread Igor Cicimov
use_backend %[req.hdr(host),lower] On Thu, Jun 23, 2016 at 6:21 AM, Mildis wrote: > Hi, > > I’m in the process of setting HAProxy as an HTTPS frontend switch to > different backends. > As I have 10+ different backends, I’d like to replace > > acl to-server1 hdr_beg(host) -i

Use regex for backend selection

2016-06-22 Thread Mildis
Hi, I’m in the process of setting HAProxy as an HTTPS frontend switch to different backends. As I have 10+ different backends, I’d like to replace acl to-server1 hdr_beg(host) -i server1.domain.tld acl to-server2 hdr_beg(host) -i server2.domain.tld … acl to-serverN hdr_beg(host) -i

Re: acl regex

2015-11-24 Thread Guillaume Bourque
Hi all, I should be able to test this in our production setup a few days after I can have an rpm ready with the patch we are running on rhel 6.x Merci Cyril --- Guillaume Bourque, B.Sc., Le 2015-11-24 à 16:58, Cyril Bonté a écrit : > Hi all, > > I revive this thread.

Re: acl regex

2015-11-24 Thread Cyril Bonté
Hi all, I revive this thread. Le 12/11/2015 09:59, Igor Cicimov a écrit : On Thu, Nov 12, 2015 at 6:44 PM, Guillaume Bourque > wrote: Hi, thanks for the suggestion but it did not work for me. I tried

Re: acl regex

2015-11-24 Thread Willy Tarreau
Hi Cyril, On Tue, Nov 24, 2015 at 10:58:47PM +0100, Cyril Bonté wrote: > Currently, haproxy won't match an url parameter if its value is empty. I > tend to think it should : an empty value is different from not providing > the parameter at all. > > The function "find_next_url_param()" should

Re: acl regex

2015-11-12 Thread Guillaume Bourque
Hi all, I’m not far but it does not work so any recommendation would be very helpfull I just need some very simple redirect but after looking into aloa doc the happy doc, I can’t find examples that could help me do this, okay I must admit I did not sleep for the last 30 hours so that could

Re: acl regex

2015-11-12 Thread Guillaume Bourque
Hourra Aleks, it’s working thanks a lot I will try more in deep in a few hour but wanted to tank you as soon as I test it Again thanks --- Guillaume Bourque, B.Sc., Le 2015-11-12 à 16:19, Aleksandar Lazic a écrit : > Hi. > > Am 12-11-2015 21:16, schrieb Guillaume

Re: acl regex

2015-11-12 Thread Aleksandar Lazic
Hi. Am 12-11-2015 21:16, schrieb Guillaume Bourque: Hi all, I’m not far but it does not work so any recommendation would be very helpfull I just need some very simple redirect but after looking into aloa doc the happy doc, I can’t find examples that could help me do this, okay I must admit I

Re: acl regex

2015-11-12 Thread Igor Cicimov
On Thu, Nov 12, 2015 at 6:44 PM, Guillaume Bourque < guillaume.bour...@logisoftech.com> wrote: > Hi, > > thanks for the suggestion but it did not work for me. I tried > >acl fr_top url_reg/?lang= >acl fr_top url_reg

Re: acl regex

2015-11-12 Thread Guillaume Bourque
Hello Igor, thanks a lot still not working would I need to escape the = > http-request redirect location /store code 301 if { capture.req.uri lang\= -m > found } Bye --- Guillaume Bourque, B.Sc., Le 2015-11-12 à 03:59, Igor Cicimov a écrit : > > > On

acl regex

2015-11-11 Thread Guillaume Bourque
Hi all, I can’t create an acl that will match this http://domain/?lang= I tried acl fr_top path_reg^/.lang\=$ acl fr_top path_reg^/\?lang\=$ acl fr_toppath_beg/?lang\=$ I

Re: acl regex

2015-11-11 Thread Bryan Talbot
On Wed, Nov 11, 2015 at 8:43 PM, Guillaume Bourque < guillaume.bour...@logisoftech.com> wrote: > Hi all, > > I can’t create an acl that will match this > > http://domain/?lang= > > I tried > > acl fr_top path_reg^/.lang\=$ > acl fr_top

Re: acl regex

2015-11-11 Thread Guillaume Bourque
Hi, thanks for the suggestion but it did not work for me. I tried acl fr_top url_reg/?lang= acl fr_top url_reg/?lang=$ # off acl fr_topurlp_reg(lang\=$,?) -m found # off acl fr_top

Re: acl regex

2015-11-11 Thread Guillaume Bourque
Hello Bryan I’m running haproxy 1.5.4 and I can’t find any example on how to user req.uri if you could give a examples on how to match a specific query to redirect to another From http://domain/pages/store.php?lang=fr to http://domain/store/ That would be great ! TIA --- Guillaume

Re: acl regex

2015-11-11 Thread Igor Cicimov
On 12/11/2015 5:30 PM, "Guillaume Bourque" < guillaume.bour...@logisoftech.com> wrote: > > Hello Bryan > > I’m running haproxy 1.5.4 and I can’t find any example on how to user req.uri if you could give a examples on how to match a specific query to redirect to another > > From

RegEx

2015-10-03 Thread mlist
It is possible to apply case function on substitution part of RegEx like that ? Request Line:GET /JSicCaravaggio/jsic.css HTTP/1.1 repireq (\/JSic)([A-Za-z])([A-Za-z]*)\/ \/JSic\2\3\/ Following regex should match "/JSicCaravaggio/" case insensitive in 3 groups: /1

Re: HAProxy - How to filter (all) Headers by Regex

2015-08-28 Thread Baptiste
Le 28 août 2015 06:31, Firman Gautama firman.gaut...@gmail.com a écrit : Hello All, I was just wondering what is the best way if we want to filter all headers by certain regex to block invalid/malicious characters? I read on the documentation, CMIIW, but the example there only shown if we

Re: HAProxy - How to filter (all) Headers by Regex

2015-08-28 Thread Firman Gautama
I'm wondering, what kind of filter that already done automatically by HAProxy as default? And how if I want to add extra 'regex' filter in the HAProxy for incoming headers, for let say I only want to allow [a-Z0-9] for example. (So I can make sure if the error msg still occurring that's mean

HAProxy - How to filter (all) Headers by Regex

2015-08-27 Thread Firman Gautama
Hello All, I was just wondering what is the best way if we want to filter all headers by certain regex to block invalid/malicious characters? I read on the documentation, CMIIW, but the example there only shown if we know the specific header name. Does anybody know how to filter all the http

RE: Regex

2015-07-28 Thread mlist
support the regex you proviced for browser URL case ? In your opinion who must manage this set-header X-Redirect-Url and location headers ? the application level ? Thank you Roberto -Original Message- From: Cyril Bonté [mailto:cyril.bo...@free.fr] Sent: lunedì 27 luglio 2015 20.35

RE: Regex

2015-07-28 Thread mlist
No, you are right, as I told you I was wrong thinking Referer had to do with the browser URL, I see only Referer in the header with wrong case, so I think that. It is only to understand haproxy regex match behavior so I've more control... :D (but antislash before /demoj is not necessary

RE: Regex

2015-07-28 Thread mlist
I wrote in the first mail I used 2 different regex. The (1) probably doesn't match, but the (2) ? (2) reqirep (.*)\/demoj(.*) \1/DemoJ\2 This regex match https://hostname, I'm Wrong ? Roberto -Original Message- From: Cyril Bonté [mailto:cyril.bo...@free.fr] Sent: martedì 28

RE: Regex

2015-07-28 Thread mlist
:... reqirep (.*)\/demoj(.*) \1/DemoJ\2 - applied to headers, this regex should match and subst correctly also for Referer: I'm wrong ? I get it to work using 2 different regex. The second matching statically Referer... reqirep

Re: Regex

2015-07-28 Thread Cyril Bonté
Hi again, On 28/07/2015 09:42, mlist wrote: I wrote in the first mail I used 2 different regex. The (1) probably doesn't match, but the (2) ? (2) reqirep (.*)\/demoj(.*) \1/DemoJ\2 This regex match https://hostname, I'm Wrong ? Good news for you, at this step, no, you

Re: Regex

2015-07-28 Thread Cyril Bonté
. No confusion to have, the documentation is right, but the regex you provided in in previous mail was wrong for what you wanted to do : it couldn't match the Referer value because it didn't expect a value beginning with https://hostname. -- Cyril Bonté

Regex

2015-07-27 Thread mlist
Hi Aleksandar, I'm compiled with USE_PCRE=yes flag. At http://cbonte.github.io/haproxy-dconv/configuration-1.6.html#4.2-reqirep In the example replace /static/ with / at the beginning of any request path. reqrep ^([^\ :]*)\ /static/(.*) \1\ /\2 I changed the regex with this: (1

Re: Regex

2015-07-27 Thread Cyril Bonté
. At http://cbonte.github.io/haproxy-dconv/configuration-1.6.html#4.2-reqirep In the example replace /static/ with / at the beginning of any request path. reqrep ^([^\ :]*)\ /static/(.*) \1\ /\2 I changed the regex with this: (1) reqirep ^([^\ :]*)\ /demoj(.*) \1\ /DemoJ\2

Re: Regex

2015-07-27 Thread Cyril Bonté
Hi again, Le 27/07/2015 19:48, Cyril Bonté a écrit : Le 27/07/2015 17:06, mlist a écrit : (...) he Browser URL often remain in wrong case. I missed that point : if you wan't to change the browser url, reg(i)rep won't do the job, you'll want a HTTP redirect response. I tend to say that

Regex

2014-12-01 Thread Sander Klein
Hi, I'm testing some stuff with quite a big regex and now I am wondering what would be more efficient. Is it more efficient to load the regex with -i or is it better to specify it in the regex So, -i (some|words) or ((S|s)(O|o)(M|m)(E|e)|(W|w)(O|o)(R|r)(D|d)(S|s)) Greets, Sander

Re: Regex

2014-12-01 Thread Willy Tarreau
Hi Sander, On Mon, Dec 01, 2014 at 02:34:26PM +0100, Sander Klein wrote: Hi, I'm testing some stuff with quite a big regex and now I am wondering what would be more efficient. Is it more efficient to load the regex with -i or is it better to specify it in the regex So, -i (some

dynamic redirect with regex capture groups

2014-10-14 Thread bjun...@gmail.com
Hi, i would like to redirect the following urls with HAProxy: www.example.at.prod.site.local - m.example.at www.example.de.prod.site.local - m.example.de . . . . apache mod_rewrite-rule: RewriteCond %{HTTP_HOST} ^(www\.)?example\.([a-z]{2,3}).prod\.site\.local$ [NC] RewriteRule ^/(.*)$

Re: acl and regex for adding www where needed

2013-09-27 Thread Chris Allison
Thanks, that has cleared that up. cheers Chris On 25 September 2013 16:15, Baptiste bed...@gmail.com wrote: Hi Chris, Here is what your configuration doing: IF there is no 'www.' at the beginning of the Host header, then add it. IF there is no 'www.' at the beginning of the Host header,

acl and regex for adding www where needed

2013-09-25 Thread Chris Allison
Hi, To ensure a permanent IP we have a haproxy instance feeding AWS ELB to a number of apache instances. All of the vhosts are pinned to www.somedomain.com rather than somedomain.com, though we have dns setup so that the endpoiont for each domain and www.domain is the haproxy box. What we need

Re: acl and regex for adding www where needed

2013-09-25 Thread Baptiste
Hi Chris, Here is what your configuration doing: IF there is no 'www.' at the beginning of the Host header, then add it. IF there is no 'www.' at the beginning of the Host header, then redirect the user to /url Here is how HAProxy works: the request buffer is different from the workspace where

Re: Stick on extracted regex value from header

2013-03-01 Thread Vivek Malik
Hi Baptise, Thanks for the suggestion. The list of possible values is in 100s and I would like to load balance on different machines while still keeping them sticky. So, stick tables is the ideal solution. However, stick tables only support pattern extractions which are limited to using full

Re: Stick on extracted regex value from header

2013-02-28 Thread Baptiste
On Thu, Feb 28, 2013 at 7:28 PM, Vivek Malik vivek.ma...@gmail.com wrote: Hi, I see that it is possible to haproxy sticky on a header value, path, query parameter. It seems that haproxy does process the request URI to extract query parameters. Is is possible to use stick tables with

Re: better ways to regex rewrite to various backends?

2012-01-12 Thread Willy Tarreau
on port 80 to keep them from being blocked by poorly configured corp firewalls. To that end I was hoping I could accept connections with HAProxy, read the uri, and rewrite to localhost:port_based_on_uri on the fly using a bit of regex. If it were just 3-4 per server I'd leave it as above

Re: better ways to regex rewrite to various backends?

2012-01-12 Thread Ramin K
On 1/12/2012 12:38 PM, Willy Tarreau wrote: But clearly if you want to map specific URL prefixes to specific servers, at one point you need to establish this mapping and I don't see how to simplify it further. Also I'd say that 40 lines is not *that* dramatic, I've already seen multi-megabytes

better ways to regex rewrite to various backends?

2012-01-10 Thread Ramin K
. To that end I was hoping I could accept connections with HAProxy, read the uri, and rewrite to localhost:port_based_on_uri on the fly using a bit of regex. If it were just 3-4 per server I'd leave it as above, but it's closer to 40 or so per server with the content system scheduling to different servers

reqrep/general regex issue

2009-08-05 Thread Dave Pascoe
Running the latest 1.3.x and have several reqrep lines in my config. No issues with rewriting /foo/(.) but I just want to rewrite: /foo to /fubar/foo and the regex that I *think* should work is not doing the job. Any help appreciated. -dave

Re: reqrep/general regex issue

2009-08-05 Thread Willy Tarreau
On Wed, Aug 05, 2009 at 12:08:12PM -0400, Dave Pascoe wrote: Running the latest 1.3.x and have several reqrep lines in my config. No issues with rewriting /foo/(.) but I just want to rewrite: /foo to /fubar/foo and the regex that I *think* should work is not doing the job. Any help