Zero to Nginix Static Web Server in 60ish Seconds
https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-20-04
From fresh install of Xubuntu 20.04 with networking configured, including firewall, DNS, and remote management
$ sudo apt update $ sudo install nginx $ sudo systemctl enable nginx
$ sudo ufw allow 'Nginx Full'
$ sudo mkdir -p /var/www/<<website_name>>/html $ sudo chown -R $USER:$USER /var/www/<<website_name>>/html $ sudo chmod -R 755 /var/www/<<website_name>>
$ sudo vi /var/www/<<website_name>>/html/index.html
<title>Welcome to your_domain!</title>See https://www.digitalocean.com/community/tutorials/understanding-nginx-server-and-location-block-selection-algorithms
$ sudo vi /etc/nginx/sites-available/<<website_name>>
server { listen 80; listen [::]:80;
root /var/www/<<website_name>>/html;
index index.html index.htm index.nginx-debian.html;
server_name <<website_name>> www.<<website_name>>;
location / {
try_files $uri $uri/ =404;
}
}
$ sudo ln -s /etc/nginx/sites-available/<<website_name>> /etc/nginx/sites-enabled/
$ sudo vi /etc/nginx/nginx.conf
Uncomment:
http { ... server_names_hash_bucket_size 64; ... }
$ sudo nginx -t $ sudo systemctl restart nginx
Browse to http://<<website_name>>