Nginx is the most-used web server for static sites and reverse proxy — install plus first vhost.
apt install -y nginx
ufw allow 'Nginx Full' # opens 80 + 443
systemctl enable --now nginx
Test: http://YOUR_IP should show the welcome page.
First site (server block)
nano /etc/nginx/sites-available/mysite
server {
listen 80;
server_name mysite.com www.mysite.com;
root /var/www/mysite;
index index.html;
location / { try_files $uri $uri/ =404; }
}
mkdir -p /var/www/mysite
ln -s /etc/nginx/sites-available/mysite /etc/nginx/sites-enabled/
nginx -t && systemctl reload nginx
nginx -t before reloading — it validates the syntax and avoids breaking all your sites.











