diff --git a/INSTALL b/INSTALL index aa9c9ffa1..493dc6ac4 100644 --- a/INSTALL +++ b/INSTALL @@ -392,6 +392,68 @@ configuration in order to launch Apache. Nginx ----- +`Nginx `_ is a really fast HTTP server. Associated +with `Green Unicorn `_, it gives you one of the +best setup to serve python/Django applications. Modoboa's +performances are really good with this configuration. + +To use this setup, first download and install those softwares +(`Install gunicorn `_ and `install +nginx `_). + +Then, use the following sample *gunicorn* configuration (create a new +file named *gunicorn.conf.py* inside Modoboa's root dir):: + + backlog = 2048 + bind = "unix:/var/run/gunicorn/modoboa.sock" + pidfile = "/var/run/gunicorn/modoboa.pid" + daemon = True + debug = False + workers = 2 + logfile = "/var/log/gunicorn/modoboa.log" + loglevel = "info" + +To start gunicorn, execute the following commands:: + + $ cd + $ gunicorn_django -c gunicorn.conf.py + +Now the *nginx* part. Just create a new virtual host and use the +following configuration:: + + upstream modoboa { + server unix:/var/run/gunicorn/modoboa.sock fail_timeout=0; + } + + server { + listen 443; + server_name ; + root ; + + access_log /var/log/nginx/.access.log; + error_log /var/log/nginx/.error.log; + + location /static/ { + autoindex on; + } + + location / { + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Host $http_host; + proxy_redirect off; + proxy_set_header X-Forwarded-Protocol https; + + if (!-f $request_filename) { + proxy_pass http://modoboa; + break; + } + } + } + +Paste this content to your configuration (replace values between +``<>`` with yours), restart *nginx* and enjoy a really fast +application! + Using default plugins =====================