Skip to content

Instantly share code, notes, and snippets.

@mrChex
Forked from timmyomahony/nginx.conf
Last active December 22, 2015 22:09
Show Gist options
  • Save mrChex/6537751 to your computer and use it in GitHub Desktop.
Save mrChex/6537751 to your computer and use it in GitHub Desktop.
change from port to unix socket
server {
listen 80;
server_name www.domain.com;
root /sites/mysite/;
access_log /path/to/nginx/access.log;
error_log /path/to/nginx/error.log;
location /media/ {
alias /path/to/project/media/;
}
location /static/ {
alias /path/to/project/static/;
}
location / {
include uwsgi_params;
uwsgi_pass unix:///path/to/unix.socket;
}
}
[program:uwsgi]
user = uwsgi
command=/opt/bin/uwsgi --ini=/path/to/uwsgi.ini
autostart=true
autorestart=true
stderr_logfile = /path/to/error.log
stdout_logfile = /path/tp/out.log
stopsignal=INT
[uwsgi]
chdir=/path/to/src
chmod=777
module=app.wsgi:application
master=True
pidfile=/path/to/file.pid
vacuum=True
max-requests=5000
daemonize=/path/to/uwsgi.log
home=/path/to/project/virtualenv/.env
socket=/path/to/unix.socket
import os,sys
import django.core.handlers.wsgi
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings.production'
application = django.core.handlers.wsgi.WSGIHandler()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment