Updated: 2019-02-18
Create your new site config file inside the /etc/nginx/sites-available directory.
sudo vim /etc/nginx/sites-available/your_site_name.com
server { listen 80; root /var/www/html/termtools/public; index index.php index.html index.htm; server_name termtools.com www.termtools.com; location / { try_files $uri $uri/ /index.php?$query_string; } location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/var/run/php/php7.2-fpm.sock; } location ~ /\.ht { deny all; } }
Create symbolic link from new server block configuration to sites-enabled directory.
sudo ln -s /etc/nginx/sites-available/your_site_name.com /etc/nginx/sites-enabled/
Unlink the default configuration file from the sites-enabled directory.
sudo unlink /etc/nginx/sites-enabled/default
Test new configuration file.
sudo nginx -t
Reload Nginx.
sudo service nginx reload
For a more detailed explanation: Check out these tutorials.