Nginx server block guides
Configure Nginx server blocks for hostnames, document roots, redirects, routing rules, and deployment-safe site structure.
Curated guides
Nginx server block guides
5 matched guides, best match first.

How to Configure Nginx Server Blocks and Virtual Hosts
Nginx server blocks let one Nginx service host multiple domains, subdomains, or applications from separate configuration blocks. Apache users often call this virtual hosting; Nginx documentation usually calls...

Nginx Location Block Priority Explained
Nginx location block priority explains why a request such as /assets/app.css may be handled by a regex block even when a normal location /assets/ block exists. The matching...

Nginx try_files Directive Explained
Nginx try_files decides what happens after a request matches a server or location block. It can serve a real file, check for a directory, send the request to...

Nginx Root vs Alias: Path Mapping and Troubleshooting
Nginx root and alias both point requests at files on disk, but they build the final filesystem path in different ways. Use root when the URI path matches...

How to Change NGINX Ports
Changing the Nginx port starts with the listen directive inside each server block, not with a global service setting. To change Nginx port 80 to 8080, update every...