May be I am using this option for wrong purpose but it works nicely when at 
least one backend is available. User is auto-redirected withount any boring 
error pages. Problem happens only when all backends are down. 

 
________________________________

From: Willy Tarreau [mailto:[email protected]]
Sent: Нд 6/27/2010 08:51
To: Христо Красимиров Григоров
Cc: [email protected]
Subject: Re: Use of errorloc303



Hi,

On Thu, Jun 24, 2010 at 09:33:45AM +0300, [email protected] wrote:
> Hi,
>
> I am not sure I use it in proper way thus I prefer to ask?
>
> I have added to a listen section errorloc303 option for 503 and 504 to 
> redirect browser back to HAproxy, so that if server client is currently bound 
> to goes down, browser is auto-redirected back to HAproxy for next server 
> selection.
>
> Now, last night unfortunately all servers went down and HAproxy looped the 
> browser and filled the log with a lot of NOSRV entries because of this.
>
> I was wondering if I am doing something wrong or HAproxy shall not redirect 
> back to itself if it knows all servers are down?

If I understand what you did, I think you misused the errorloc. It
is designed to redirect to *another* site exactly to make the type
of loop you encountered impossible.

The most common usage is when sites are split between dynamic (eg: PHP)
and static. You want an errorloc statement on the dynamic part to
redirect to a nice "sorry page" on the statics farm (both of whom
can be hosted on the same haproxy if you want). But you must never
make the URL point to the place where it failed, otherwise you
create the loop you have observed.

Regards,
Willy



Reply via email to