How to Add New Websites on Nginx Ubuntu 16.04 Server

Let’s say you have installed full LEMP stack (Linux, Nginx, MySQL/MariaDB, and PHP) but how can you add new websites or domains on it? The answer is by creating Virtual Hosts or Server Blocks. The main point is to create a Virtual Block file for each of your website / domain. It means you have to create another Server Block for another website you want to add. Going back to basic, an Nginx Server Block is configuration file holding all necessary configuration for websites you want it to be made accessible through and served by Nginx. Basically you can put all configurations of all websites in a single Server Block file but we believe it is better to have separate Server Block for each website. Continue reading “How to Add New Websites on Nginx Ubuntu 16.04 Server”