Deploying with uWSGI and Nginx
For those who are already aware of the usefulness of uWSGI and Nginx, not much needs to be explained. uWSGI is a protocol as well as an application server and provides a complete stack so that you can build hosting services. Nginx is a reverse proxy and HTTP server that is very lightweight and capable of handling virtually unlimited requests. Nginx works seamlessly with uWSGI and provides many under-the-hood optimizations for better performance. In this recipe, we will use uWSGI and Nginx together to facilitate the deployment of our application.
Getting ready
We will use our application from the previous recipe, Deploying with Apache, and use the same wsgi.py
file.
Now, install Nginx and uWSGI. On Debian-based distributions such as Ubuntu, they can be easily installed using the following commands:
$ sudo apt-get install nginx $ pip install pyuwsgi
These installation instructions are OS-specific, so please refer to the respective documentation...