Skip to content

Instantly share code, notes, and snippets.

@josezambrana
Created November 16, 2012 19:50
Show Gist options
  • Save josezambrana/4090312 to your computer and use it in GitHub Desktop.
Save josezambrana/4090312 to your computer and use it in GitHub Desktop.
Ejemplo de configuración para nginx, supervisord, gunicorn
# -*- coding: utf-8 -*-
import multiprocessing
bind = "127.0.0.1:8000"
workers = multiprocessing.cpu_count() * 2 + 1
worker_class = 'gevent'
pidfile = '/tmp/example.pid'
logfile = '/path/to/logs/example.com.log'
loglevel = 'warning'
server {
listen 80;
root /opt/django/htdocs;
server_name example.com www.example.com;
access_log /path/to/logs/nginx/example_access.log;
error_log /path/to/logs/nginx/example_error.log;
location / {
proxy_pass http://127.0.0.1:8000;
}
}
server {
listen 80;
server_name static.example.com;
location / {
root /path/to/projects/example.com/static;
}
}
[program:example]
directory=/path/to/projects/example.com/repository/
command=/path/to/projects/example.com/env/bin/python /path/to/projects/example.com/repository/manage.py run_gunicorn -c gunicorn.conf
user=django
autostart=true
autorestart=true
redirect_stderr=True
environment=HOME='/path/to/projects/example.com/repository/'
stdout_logfile=/path/to/logs/example_out.log
stderr_logfile=/path/to/logs/example_err.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment