On 5 April 2012 13:18, Pedro Mata-Mouros <[email protected]> wrote:
> Thanks :-)
>
> Ok, I almost got it... The backend stuff and the errorfile trick is working, 
> but I'm having a few problems with the content switching rule. So here's the 
> backend stuff:
> backend options
>        server vm-host01 127.0.0.1:8081 maxconn 50 disabled
>        errorfile 503 /tmp/resp.txt
>
> At first I tried this rule:
> acl req_options                METH_OPTIONS   path_beg   /url1
> use_backend options     if                   req_options
>
> But that doesn't pass the configuration parser:
> [ALERT] 095/124538 (2706) : parsing [/etc/haproxy.conf:41] : error detected 
> while parsing ACL 'req_options'.
> [ALERT] 095/124538 (2706) : parsing [/etc/haproxy.conf:56] : error detected 
> while parsing switching rule.
> [ALERT] 095/124538 (2706) : Error(s) found in configuration file : 
> /etc/haproxy.conf
> [ALERT] 095/124538 (2706) : Fatal errors found in configuration.
>
> So then I tried:
> acl req_options                path_beg   /url1  METH_OPTIONS
> use_backend options     if                   req_options

Does this work?

  acl path_match path_beg /url1
  use_backend options if path_match METH_OPTIONS

It seems more visible to me to avoid acl accumulation at definition
time, and to make the use_backend the place that they're AND'd. YMMV.

Jonathan
-- 
Jonathan Matthews
London, Oxford, UK
http://www.jpluscplusm.com/contact.html

Reply via email to