Hi,

On Wed, Aug 13, Dave Shevett wrote:
> Hi everyone.  We have a set of load balanced back end appservers behind
> haproxy.  We're running pretty large amount of traffic and things have
> been running great for the last 2 years or so.
> 
> We'd like the ability to manually specify a back end server within a
> cluster (this has to do with running a command to flush out the cache on
> a specific server). 
> 
> Without manually altering the cookie in the browser to specify which
> back end server to use, can we do something like add a string onto the
> URL to specify which of the back end servers to use?
> 
> For the following config, we normally hit http://stg.redacted.com, and
> it sets the HASRVID cookie which it uses to specify the back end.  Can
> we do something like http://stg.redacted.com/?HASRVID=stg-2 to manually
> select the back end?
> 
> Here's the relevant sections of our config file:
> 
> defaults
>     balance roundrobin
> 
> frontend http_proxy
>     use_backend blahblah
> 
> backend blahblah
>     mode http
>     option httpchk GET /magicurl
>     cookie HASRVID insert indirect nocache
> 
>     server stg-1 stg-1.REDACTED.com:80 cookie stg-1 check inter 10000
> rise 2 fall 5
>     server stg-2 stg-2.REDACTED.com:80 cookie stg-2 check inter 10000
> rise 2 fall 5
>     server stg-3 stg-3.REDACTED.com:80 cookie stg-3 check inter 10000
> rise 2 fall 5

I'm using casperjs for some checks and I have something like this:
backend blahblah
        acl is_nagios_host src nagios.host.ip
    acl is_nagios_host1 hdr_end(User-Agent) nagios-host1
    acl is_nagios_host2 hdr_end(User-Agent) nagios-host2

    use-server host1 if is_nagios_host is_nagios_host1
    use-server host2 if is_nagios_host is_nagios_host2

        server host1 ...
    server host2 ...

Maybe something similar could work for you (using url instead of
User-Agent) ?

-Jarno

-- 
Jarno Huuskonen

Reply via email to