I have a Django app running gunicorn - I now want to replace it with waitress. Easy enough, I installed waitress via apt-get install python-waitress
, and ran it via waitress-serve --port=8080 myproject.wsgi:application
.
Now I want to set this up to run via an Upstart file (I'm on Ubuntu). I want it to run on normal runlevels 2, 3, 4, and 5, and tell it to stop when its in any other runlevel (such as when the system is rebooting, shutting down, or in single-user). I also want Upstart to automatically restart the service if it fails. Last but not least, I need waitress
to run on port 80, not port 8080.
My questions are: how do I construct my Upstart file to reflect those requirements? And any other inclusions that will be helpful additions? Please advise; this is my main production server.
Secondly, as per waitress
itself, other than being able to use it with SSL, are there any advantages of using a reverse proxy (such as Nginx
) with waitress
? My application is a read heavy Django web app where users congregate and chat with one another.