One of the few things that most sites need to do is deploy code, and usually do it when the site is running on production. Nginx is really amazing in terms of how it can easily reload its configuration without terminating the client connections. You can have a look at the reloading recipe in the previous chapter to know more. In this recipe, we will have a look at a simple way of setting up a system which can make your deployment pain free for the end user and you as well!
Let's run through step-by-step what one needs to do to make a working deployment. In the process the various configuration changes will also be outlined.
Create a directory which has the temporary "Coming back soon" HTML file. Let's call this
/var/www/www.example1.com/deployment/
and the file isindex.html
.You need to create an alternative configuration file which will be called
temporary.conf
. This file basically replaces the server configuration forwww.example1...