Created
August 3, 2011 15:04
-
-
Save almet/1122843 to your computer and use it in GitHub Desktop.
Or how to deploy a django application using nginx + gunicorn + supervisord
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
backlog = 2048 | |
daemon = False | |
debug = True | |
workers = 3 | |
logfile = "/usr/local/www/lolnet.org/reader/reader.gunicorn.log" | |
loglevel = "info" | |
bind = "unix:/usr/local/www/lolnet.org/reader/reader.gunicorn.sock" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
server_name reader.lolnet.org; | |
keepalive_timeout 5; | |
location /static/ { | |
alias /usr/local/www/lolnet.org/reader/reader/media/; | |
} | |
location /media/ { | |
alias /usr/local/www/lolnet.org/reader/reader-venv/lib/python2.6/site-packages/django/contrib/admin/media/; | |
} | |
location / { | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header Host $http_host; | |
proxy_redirect off; | |
proxy_connect_timeout 90; | |
proxy_send_timeout 180; | |
proxy_read_timeout 180; | |
proxy_buffer_size 16k; | |
proxy_buffers 8 16k; | |
proxy_busy_buffers_size 32k; | |
proxy_intercept_errors on; | |
if (!-f $request_filename) { | |
proxy_pass http://django_backend; | |
break; | |
} | |
} | |
} | |
upstream django_backend { | |
server unix:/usr/local/www/lolnet.org/reader/reader.gunicorn.sock; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# BASIC STUFF [...] | |
# CONF | |
[program:reader] | |
command=/usr/local/www/lolnet.org/reader/reader-venv/bin/gunicorn_django -c /usr/local/www/lolnet.org/reader/gunicorn.conf.py /usr/local/www/lolnet.org/reader/reader/settings.py | |
directory=/usr/local/www/lolnet.org/reader/reader | |
user=www | |
autostart=true | |
autorestart=true | |
redirect_stderr=True |
Oh, ppl are reading, awesome.
Heh, you've made it public man! What did you expect? :D
Checkout mine if you wanna ;)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hum, maybe I'll be the only one around not understanding what this is for, but just in case I suggest you add a short description :)