From 7b02420ed7160e6b39fc69f8985629faea48a5d2 Mon Sep 17 00:00:00 2001 From: benoitc Date: Fri, 26 Mar 2010 16:26:59 +0100 Subject: [PATCH] sync --- doc/htdocs/deployment.html | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/doc/htdocs/deployment.html b/doc/htdocs/deployment.html index 0a20eeff..10f9b2ac 100644 --- a/doc/htdocs/deployment.html +++ b/doc/htdocs/deployment.html @@ -49,9 +49,9 @@

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.

-
-

Nginx Config

+

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 for fast clients hanling

An example configuration file for use with Nginx:

 worker_processes 1;
@@ -105,6 +105,22 @@ http {
     }
 }
 
+

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