Thanks. So essentially I make two different backends, one with the rspi statements and one without, then use the ACL to choose between them. That makes sense.
WILL On Mon, Nov 4, 2013 at 7:52 AM, Baptiste <[email protected]> wrote: > Hi Will, > > Your using a response rewrite statement while matching a request > information. > The request is not in HAProxy anymore when the rspi* functions are > processed by HAProxy. > > If you want to do this, then I would do a use-backend with the app-api > acl, then in this backend, run the rspi* statement to add/delete the > headers. > > Baptiste > > On Fri, Nov 1, 2013 at 6:12 AM, Will Glass-Husain <[email protected]> > wrote: > > Hi, > > > > Can someone help me understand why I can't use ACL's (in a backend or > > frontend) with rspidel and rspadd? Specifically what I am trying to do > is > > add a header to a response for specific URLs. > > > > Here's the error I get. It works if I leave off "if app-api". > > > > [WARNING] 303/235646 (19685) : parsing [temp.cfg:49] : acl 'app-api' will > > never match because it only involves keywords that are incompatible with > > 'backend http-response header rule' > > Configuration file is valid > > > > with a haproxy.cfg containing this backend (excerpt): > > > > backend app > > > > server app1 10.0.2.11:8080 cookie app1 check inter 10000 > > acl app-api path_beg /app/api/ > > rspidel Access-Control-Allow-Origin:.* if > app-api > > rspadd Access-Control-Allow-Origin:\ *.abc.org if > app-api > > > > > > > > Thanks, WILL > > > -- William Glass-Husain /forio | +1 (415) 440 7500 x89 | forio.com<http://www.forio.com/>

