Adding a static website
This section describes the steps for adding websites, following these references:
Nginx Multisite - Documentation
Generating SSL Keys - Let's Encrypt - Documentation
Create a directory for the website HTML content.
mkdir -p /usr/share/nginx/html/newsite.comAdd default index.html
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Site 1</title> </head> <body> <h1>Helo vino</h1> </body> </html>
Change to /etc/nginx
Create sites-available and sites-enabled
mkdir /etc/nginx/sites-enabled mkdir /etc/nginx/sites-available
Add sites-enabled support, by adding this line after (include /etc/nginx/conf.d/*.conf;)
include /etc/nginx/sites-enabled/*.conf;
Comment out the default server section
Restart the webserver
Create the website configuration file (sites-available/newsite.com.conf)
Activate the site
Test everything and restart
Add an SSL certificate with certbot
Remove the section that causes loops