Leave a Comment

If you already have multiple Django apps running behind Nginx, you're most of the way there. In order to server a static site, you would just need another "server block" in your Nginx configuration. You'll also need to set up DNS records. By setting the server_name directive in each of your server blocks, Nginx will know where to direct requests.

In the example, requests to example.com will serve static content from /var/www//html One to app1.example.com will serve a Django app listening on port 9000 and app2.example.com will serve the app listening on port 7000.

You can get more info on how to use Nginx server block in this tutorial: