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

Password Protect Nginx with Basic Authentication
Basic Authentication is useful when a staging site, preview build, private download area, or low-traffic admin path needs a quick gate before a full application login exists. To...

How to Configure CORS in Nginx
CORS becomes a server problem as soon as a browser app at one origin needs to read an API, font, image, or JSON response from another origin. To...

How to Configure Browser Caching for Static Assets in NGINX
Browser cache headers decide whether visitors download the same CSS, JavaScript, font, and image files on every page view or reuse files they already have. To configure browser...

How to Enable HTTP/2 in Nginx
HTTP/2 in Nginx has a version split that matters before editing a live HTTPS server block. Nginx 1.25.1 introduced the standalone http2 on; directive and deprecated the older...

How to Configure Nginx Proxy Cache
Nginx proxy cache stores selected upstream responses on disk so repeated requests can be served from Nginx instead of hitting the backend every time. It is useful for...

How to Fix Nginx 413 Request Entity Too Large Errors
Nginx returns 413 Request Entity Too Large when a client sends a request body that is larger than the layer handling the request allows. File uploads are the...

How to Configure an Nginx WebSocket Proxy
Nginx WebSocket proxying breaks when a normal Nginx reverse proxy handles regular HTTP requests but does not pass the upgrade handshake to the backend. The page may load,...

How to Fix Nginx 504 Gateway Timeout Errors
An Nginx 504 Gateway Timeout error means Nginx waited too long for the next upstream step to complete. The upstream might be a reverse-proxied application, a PHP-FPM pool,...

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...

Nginx Access and Error Logs Guide
Nginx access logs and error logs remove guesswork when a site returns the wrong page, hides a static file, breaks a reverse proxy, or fails after a configuration...

Nginx proxy_pass Trailing Slash Explained
Nginx proxy_pass path handling is one of the easiest ways to create a reverse proxy that looks correct but sends the wrong URI to the backend. The small...