Re: select backend based on URI?

From: Alexander Staubo <alex#bengler.no>
Date: Fri, 30 Jan 2009 19:59:51 +0100


On Fri, Jan 30, 2009 at 7:40 PM, Michael Fortson <mfortson#gmail.com> wrote:
> It doesn't look like this is supported yet since acl only supports
> block, but I'd like to route incoming requests based on the URI.

That's extremely basic, actually. On paths:

  acl static path_beg /images/ /stylesheets/ /javascripts/   use_backend webserver if static
  default_backend mongrel

On hosts:

  acl site1 hdr_reg(host) site1.com
  acl site2 hdr_reg(host) site2.com
  use_backend web1 if site1
  use_backend web2 if site2

On path *and* host:

  use_backend web1 if site1 static
  use_backend web2 if site2 static

Everything is covered here:

  http://haproxy.1wt.eu/download/1.3/doc/configuration.txt

Alexander. Received on 2009/01/30 19:59

This archive was generated by hypermail 2.2.0 : 2009/01/30 20:15 CET