This article covers how to create an Nginx server block configuration to host multiple website on a single CentOS server.
Server Blocks, often referred to as Nginx virtual host are a feature of the Nginx web server that allows you to host multiple websites on one server.
To Test NGINX configuration file, run the command:
$ sudo nginx --t
If the syntax is OK, the output tells you the test was successful.
To restart your Nginx web server and confirm that it's running as expected:
$ sudo systemctl restart nginx
$ sudo systemctl status Nginx
To Enable HTTPS on Domain Hosted on Nginx:
You may consider encrypting your domain using Lets Encrypt SSL to add a layer of protection and secure traffic to and from the webserver:
$ sudo dnf install certbot python3-certbot-nginx
$ sudo certbot --nginx