ACL '-f' option not working

2013-08-26 Thread Qingshan Xie
I tried to use 'ACL -f' to upload the pattern from a file but cannot make it 
work.  I configured it as below, 
frontend PUBLIC
       bind :80
       acl rec_w7 path_beg -f test.cfg
       use_backend WAS7-BACKEND if rec_w7
..

Here test.cfg is a file containing one pattern as below, 
/abc/
It works if I directly code them in as 
frontend PUBLIC
       bind :80
       acl rec_w7 path_beg /abc/
       use_backend WAS7-BACKEND if rec_w7
..

Can some one helps?

Thanks, Q.Xie

content based routing with rewrite (reqrep)

2013-08-26 Thread Patrick Hemmer
So I'm trying to come up with the best way of doing this, but am having
a heck of a time. Basically I have several different backend service
pools, and I have one externally facing haproxy router. I want to take a
map of public URLs and route them to specific backend URLs.
For example

public.example.com/foo/bar - foo.internal.example.com/one
public.example.com/foo/baz - foo.internal.example.com/two
public.example.com/another - more.internal.example.com/three

So the first 2 public URLs go to the same backend, but need different
rewrite rules.

I've tried doing the following config:
frontend public
  acl foo_bar path_dir /foo/bar
  reqrep ^([^\ ]*\ )/foo/bar(.*) \1/one\2 if foo_bar
  use_backend foo if foo_bar

Except it seems that the foo_bar acl isn't cached, and get's
re-evaluated after doing the reqrep, and so the use_backend fails.

The only way I can think of doing this is to put the acl and the
use_backend in the frontend, and then put the acl again with the reqrep
in the backend. Is there any cleaner way (if it works since I haven't
tried it yet)?

-Patrick