This commit is contained in:
benoitc 2010-03-26 16:26:59 +01:00
parent eb91338852
commit 7b02420ed7

View File

@ -49,9 +49,9 @@
<div class="document" id="production-setup"> <div class="document" id="production-setup">
<h1 class="title">Production Setup</h1> <h1 class="title">Production Setup</h1>
<p>Although there are many HTTP proxies available, we strongly advise that you use <a class="reference external" href="http://www.nginx.org">Nginx</a>. 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.</p> <p>Although there are many HTTP proxies available, we strongly advise that you use <a class="reference external" href="http://www.nginx.org">Nginx</a>. 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.</p>
<div class="section" id="nginx-config"> <div class="section" id="nginx-config-for-fast-clients-hanling">
<h1>Nginx Config</h1> <h1>Nginx Config for fast clients hanling</h1>
<p>An <a class="reference external" href="http://github.com/benoitc/gunicorn/blob/master/examples/nginx.conf">example configuration</a> file for use with <a class="reference external" href="http://www.nginx.org">Nginx</a>:</p> <p>An <a class="reference external" href="http://github.com/benoitc/gunicorn/blob/master/examples/nginx.conf">example configuration</a> file for use with <a class="reference external" href="http://www.nginx.org">Nginx</a>:</p>
<pre class="literal-block"> <pre class="literal-block">
worker_processes 1; worker_processes 1;
@ -105,6 +105,22 @@ http {
} }
} }
</pre> </pre>
<p>To handle sleepy applications, just add the line <cite>proxy_buffering off;</cite> under the proxy_redirect directive:</p>
<pre class="literal-block">
...
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;
}
}
....
</pre>
</div> </div>
<div class="section" id="daemon-monitoring"> <div class="section" id="daemon-monitoring">
<h1>Daemon Monitoring</h1> <h1>Daemon Monitoring</h1>