参考链接

1
2
3
4
5
6
7
8
9
10
11
12
13
sudo cp /etc/nginx/sites-available/default /etc/nginx/sites-available/xxx.com
sudo vi /etc/nginx/sites-available/xxx.com

###########################
server {
...
listen 80;
listen [::]:80;
root /var/www/xxx.com;
server_name xxx.com;
...
}
###########################
1
sudo ln -s /etc/nginx/sites-available/xxx.com /etc/nginx/sites-enabled/
1
2
sudo nginx -t
sudo systemctl reload nginx