redirect prefix in v1.5.14 and v1.4.22

2015-10-08 Thread Diana Hsu (ditsai)
Hello,

I have two hosts, one has haproxy 1.4.22 installed and the other has haproxy 
1.5.14 installed.
The following rewrite config works as expected in 1.5.14, but not in v1.4.22:

1.5.14

frontend HTTP-IN

bind 10.10.10.1:8080

acl URL-REWRITE path_beg /test

reqirep ^([^\ ]*)\ /test/(.*)\1\ /xyz/\2

redirect prefix / code 301 if URL-REWRITE

1.4.22

listen HTTP-IN 10.10.10.2:8080

acl URL-REWRITE path_beg /test

reqirep ^([^\ ]*)\ /test/(.*)\1\ /xyz/\2

redirect prefix / code 301 if URL-REWRITE


If I access http://10.10.10.1:8080/test/mytest.jsp  it returns 
http://10.10.10.1:8080/xyz/mytest.jsp
If I access http://10.10.10.2:8080/test/mytest.jsp  it returns same url 
http://10.10.10.2:8080/test/mytest.jsp

Seems to me "redirect prefix" in 1.4.22 has no effect at all?  Is this a known 
behavior in 1.4.22?  Since the version is too old, I can't get much info from 
googling.

Thanks and Regards,
Diana



RE: redirect prefix in v1.5.14 and v1.4.22

2015-10-08 Thread Lukas Tribus
Hi Diana,


> Hello, 
>  
> I have two hosts, one has haproxy 1.4.22 installed and the other has  
> haproxy 1.5.14 installed. 
> The following rewrite config works as expected in 1.5.14, but not in v1.4.22:

You probably want to check whether both 1.4.22 and 1.5.14 executables
have been build with PCRE.

Compare "haproxy -vv" output for this.

I think maybe the 1.4.22 has been compiled without PCRE. What then
happens is that haproxy falls back to the libc's regex engine, which may
not support the syntax you are using.



Regards,

Lukas