From eb913388522932e110767cfae57972dc6799601e Mon Sep 17 00:00:00 2001 From: benoitc Date: Fri, 26 Mar 2010 16:26:19 +0100 Subject: [PATCH] more doc edit. fix README. spotted by temoto on irc --- README.rst | 2 +- doc/site/deployment.rst | 22 +++++++++++++++++++--- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index e071abb1..a7d2c95c 100644 --- a/README.rst +++ b/README.rst @@ -18,7 +18,7 @@ Or from Pypi:: $ easy_install -U gunicorn -If you want to handle `sleepy application `_ you will need to install `Eventlet`_ or `Gevent`_. +If you want to handle `sleepy application `_ you will need to install `Eventlet`_ or `Gevent`_. To install eventlet:: diff --git a/doc/site/deployment.rst b/doc/site/deployment.rst index 9418023d..e207be13 100644 --- a/doc/site/deployment.rst +++ b/doc/site/deployment.rst @@ -4,10 +4,10 @@ title: Deployment Production Setup ================ -Although there are many HTTP proxies available, we strongly advise that you use Nginx_. If you choose another proxy server you need to make sure that it buffers slow clients. Without this buffering Gunicorn will be easily susceptible to Denial-Of-Service attacks. +Although there are many HTTP proxies available, we strongly advise that you use Nginx_. If you choose another proxy server you need to make sure that it buffers slow clients when you use default Gunicorn arbiter. Without this buffering Gunicorn will be easily susceptible to Denial-Of-Service attacks. -Nginx Config ------------- +Nginx Config for fast clients hanling +------------------------------------- An `example configuration`_ file for use with Nginx_:: @@ -61,6 +61,22 @@ An `example configuration`_ file for use with Nginx_:: } } } + +To handle sleepy applications, just add the line `proxy_buffering off;` under the proxy_redirect directive:: + + ... + location / { + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Host $http_host; + proxy_redirect off; + proxy_buffering off; + + if (!-f $request_filename) { + proxy_pass http://app_server; + break; + } + } + .... Daemon Monitoring -----------------