Re: All backends appear to be used despite acls

From: Willy Tarreau <w#1wt.eu>
Date: Thu, 7 May 2009 06:11:50 +0200


Hello,

On Wed, May 06, 2009 at 06:55:09PM -0700, Brian Long wrote:
> Hello,
>
> I'm trying to configure haproxy to route static urls to Apache, and dynamic
> (api-rpc) requests straight to Tomcat.
>
> The config looks like:
>
> backend static
> mode http
> option forwardfor
> balance roundrobin
> server apache:http localhost:8888 check inter 2000 rise 2 fall 5
>
> backend api
> mode http
> option forwardfor
> balance roundrobin
> server tomcat:http localhost:8080 check inter 2000 rise 2 fall 5
>
> frontend web *:80
> acl URL_API path_beg /api
> use_backend api if URL_API
> use_backend static if ! URL_API
>
> e.g. any incoming request starting with /api should go to Tomcat, listening
> on port 8080. Everything else goes to Apache, listening on port 8888.
>
> It seems as though both backends are being used, because when i hit /
> sometimes I will get index.html served by Apache, other times I will get the
> "welcome to Tomcat" page.
>
> What's wrong with this config?

you don't have "option httpclose" in your frontend, and since haproxy does not support keepalive yet, it only sees the first request of a session and sends that session to a server once for all.

Regards,
Willy Received on 2009/05/07 06:11

This archive was generated by hypermail 2.2.0 : 2009/05/07 06:15 CEST