Skip to content

Instantly share code, notes, and snippets.

@asmallteapot
Created February 27, 2012 19:42
Show Gist options
  • Select an option

  • Save asmallteapot/1926548 to your computer and use it in GitHub Desktop.

Select an option

Save asmallteapot/1926548 to your computer and use it in GitHub Desktop.
Upstart configuration for uWSGI serving a Django project to a socket. I’m using this with Nginx on Ubuntu 11.10 in production for a smallish RESTful API.
#!upstart
description "uWSGI server for example.com"
start on startup
stop on shutdown
script
exec sudo -u www-data /usr/bin/uwsgi --plugins http,python \
--chmod-socket --socket /tmp/example.sock \
--wsgi-file /srv/www/example.com/example/config.wsgi \
--callable app \
--processes 10 \
--harakiri 15 \
--logto /srv/www/example.com/logs/uwsgi.log
end script
post-stop script
rm /tmp/example.sock
end script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment