Proper display of a "server overloaded" page

Hi,
I want to set up a small static HTML Page that informs visitors that our
site is currently under load if an appserver cannot handle the request
within N seconds.

What would be the proper way to do this? Just set up a 504.html error
page? And what are the different conditions when nginx will return a 503
vs a 504?
Are there subtle behavioral differences between a proxy_pass statement
and
an upstream pool definition?

Thanks,
Sven


Sven Riedel ∙ Senior Systems Architect
Central Systems Architecture
ProSiebenSat.1 Digital GmbH ∙ Ein Unternehmen der ProSiebenSat.1 Media
AG
Medienallee 4 ∙ D-85774 Unterföhring ∙
[email protected]
Geschäftsführer: Markan Karajica (Vorsitzender), Dr. Sebastian Weil,
Thomas Port
Firmensitz: Unterföhring ∙ HRB 130417 AG München ∙ USt.-ID.-Nr. DE
218559421 ∙ St.-Nr. 9143/104/10137

Hello!

On Mon, Mar 24, 2014 at 06:20:03AM +0000, Riedel Sven wrote:

Hi,
I want to set up a small static HTML Page that informs visitors that our
site is currently under load if an appserver cannot handle the request
within N seconds.

What would be the proper way to do this? Just set up a 504.html error
page? And what are the different conditions when nginx will return a 503
vs a 504?
Are there subtle behavioral differences between a proxy_pass statement and
an upstream pool definition?

There two errors which can be returned by proxy module in case of
upstream problems: 502 (if an error occurs) and 504 (if a request
times out). Usually it’s good idea to handle both of them.

The 503 code is never used by proxy, it’s only returned by
limit_conn / limit_req.


Maxim D.
http://nginx.org/