Skip to main content
Kill -9 Club
Sign in

server block (virtual host)

Web

Nginx's unit of one site: a server { … } block naming the ports it listens on, the domain names it handles, and the root it serves files from. Writing the file does not put the site online. Nginx reads only /etc/nginx/sites-enabled/, so the file you dropped in sites-available/ stays inert until a sudo ln -s links it in — and a forgotten symlink is silent. nginx -t calls the configuration fine, systemctl reload nginx succeeds, and the site still does not answer. The second half is selection: several blocks share one address, and Nginx picks by matching the request's Host header against server_name. With no match the request falls to the default block — on a fresh install that is default, answering "Welcome to nginx" for every name you have not configured.

Also written: virtual host, vhost, sites-enabled