Created
November 16, 2012 19:50
-
-
Save josezambrana/4090312 to your computer and use it in GitHub Desktop.
Ejemplo de configuración para nginx, supervisord, gunicorn
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
# -*- 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' |
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 { | |
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; | |
} | |
} |
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
[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