Nginx index and autoindex Modules: Default Homepages and Directory Listings, Tested
When deploying a site with Nginx, directory access comes down to two questions: when a user visits a directory, which file gets returned first? And when the directory has no default file, does Nginx answer with 403, 404, or a file listing? The first question belongs to the index module, the second to the autoindex module. Misconfigure these two and the most common symptom is a homepage that returns 403 out of nowhere. This article covers both modules’ directives side by side, with container t...
The Nginx mirror Module: A Practical Guide to Traffic Mirroring
Want to replay production traffic in a real environment without affecting users? That is exactly what Nginx’s mirror module does: every incoming request, in addition to going to the primary backend, gets a copy forwarded to one or more mirror backends. The mirror request’s response is discarded outright, and the client never notices a thing. This post covers what the mirror module is for, how to configure it, and the common pitfalls. What the mirror Module Is ForThe mirror module mirrors clie...
Nginx try_files: One Directive to Govern Static File Lookup and Fallback
Deploy a Vue or React frontend to Nginx: the home page loads fine, clicking through to /orders/42 works too — then the user hits F5 on that page and a 404 lands right in their face. The reason: /orders/42 is a virtual path created by the frontend router; it doesn’t exist on disk, and with no file to find Nginx can only return 404. The conclusion up front: a single try_files directive solves this class of problem — the earlier arguments check for files in order, and the last argument decides “...
The Nginx satisfy Directive: Combining Multiple Access Controls
When a location carries both an IP whitelist and password authentication, how many checkpoints does a request have to pass? The satisfy directive answers exactly that: any means passing any single checkpoint is enough, all means every checkpoint must be passed. Policies like “password-free inside the intranet, password required from outside” are built entirely on it. But its interplay with the writing order of allow/deny, and its relationship with the return directive, hide several traps...
The Nginx auth_request Module: Handing Authentication to an External Service
When you want access control on a path but don’t want to copy authentication logic into every backend service, Nginx’s auth_request module exists for exactly that scenario: Nginx forwards the request to an authentication endpoint first, gets a status code back, and then decides whether to allow or reject. This post runs the entire chain in an nginx:1.28 container — allow, two kinds of rejection, endpoint protection — plus two configuration pitfalls that make auth_request silently stop working...
Nginx auth_basic: Basic Authentication Configuration Examples and Hardening
When internal admin pages or monitoring dashboards shouldn’t sit naked on the public internet, but you’re not ready for a full OAuth setup, Nginx’s built-in auth_basic module fills the gap exactly—two lines of configuration plus a password file keep every anonymous request out. This article covers the basic configuration, common hardening combinations, two classic mistakes, and finishes with advanced usage under OpenResty. All configurations were tested inside an nginx/1.31.5 container (...
The Nginx Configuration File: Common Directives and Typical Scenarios
Every Nginx capability — static sites, reverse proxying, load balancing, caching, rate limiting — is organized through a single configuration file. Knowing what the common directives do and where their pitfalls lie is the prerequisite for mastering Nginx. This post walks through “file structure → high-frequency directives → typical scenarios”, with key behaviors verified in containers. Jump to your goal: for overall behavior read “The Configuration File Structure”, for concurrency read worker...
Server Hardware Fundamentals
Anyone reading a server quote for the first time usually wonders: CPU plus memory plus storage either way — why does a server cost several times more than a high-spec PC? The difference is not in compute power; it hides in three constraints — it must not go down, it must not miscalculate, and when something breaks nobody is standing at the data center. This post walks through the 12 core server hardware components, and for each one answers the same question: what does enterprise-grade design ...
What Is a Container: How It Works, How It Differs from VMs, and Where It Fits
Move an app from a dev machine to a test machine and a library goes missing; move it from test to production and the glibc version does not match — developers and ops teams both know the “it works on my machine” wrangling well. Containers are a packaging approach born to end exactly this wrangling: they box up the application together with its entire dependent environment, so it runs against the same stack wherever you move it. This post makes three things clear: what a container actually is,...
Restricting IP Access in Nginx: allow and deny
Ops scenarios constantly call for restricting access to certain IPs: the admin entrance open only to the company subnet, an API directory reserved for the monitoring machine. Nginx provides two directives for this, allow and deny. The rules themselves are two lines, but three spots — matching order, scope, and subnet syntax — can easily produce “configured but not working” or “locked myself out too.” This post tests each of the three typical patterns in a container, then uses a wrongly-ordere...