Bog'liq Mastering Ubuntu Server Gain expertise in the art of deploying, configuring, managing, and troubleshooting Ubuntu Server by Jay LaCroix (z-lib.org)
[ 368 ] Change them to this:
listen 80;
listen [::]:80;
Next, we'll need to adjust the
server_name
option to refer to the name of our new site.
Add this line:
server_name acmesales.com www.acmesales.com;
Now, we'll need to change the document root to the directory that will store the files
for our new site. Find this line:
root /var/www/html;
And change it to this:
root /var/www/acmesales.com;
The final file should look
like the following at this point:
server {
listen 80;
listen [::]:80;
root /var/www/acmesales.com;
index index.html index.htm index.nginx-debian.html;
server_name acmesales.com www.acmesales.com;
location / {
try_files $uri $uri/ =404;
}
}
You can probably see that the configuration format for NGINX configuration files
is simpler than with Apache. I find this to be true, and I've noticed that sites I've
configured with NGINX generally have fewer lines in their configuration files than
Apache does.