February 2018
Beginner to intermediate
348 pages
9h 40m
English
In Apache, virtual hosts are optional. You are allowed to define server settings at the root of the configuration file:
Listen 80 ServerName example.com ServerAlias www.example.com DocumentRoot "/home/example.com/www" [...]
However, this behavior is useful only if you are going to host one website on the server, or if you want to define default settings for incoming requests that do not match other virtual host access rules. In Nginx, however, all the websites you will be hosting must be placed in a server block which allows the creation of a virtual host, equivalent to the <VirtualHost> section in Apache. The following table describes the translation of an Apache <VirtualHost> section to an Nginx server block:
Read now
Unlock full access