Scheduled Oracle Backups with Bash Scripts and expdp, Shipped Off-Site
An Oracle backup isn’t a real safety net if it only lives on the database server itself: if the local disk dies or the machine disappears, the backup disappears with it. This post records a complete working setup — expdp exports the database on a schedule, a script handles compressing and packaging, and the backup is then uploaded to another server through a receiving endpoint built with OpenResty. Prerequisites Database connection details: you can connect to the Oracle database you want to b...
Containers Explained: How They Work, Their Advantages, and How They Differ from VMs
Every ops person who has moved an application from a test machine to a production server has met the same thing: a program that ran perfectly starts erroring in a new environment — missing libraries, wrong versions, changed config paths. Containers were built squarely against this problem. This post makes clear what a container is, what contradiction it resolves, how it differs from a virtual machine, and which scenarios should avoid it. What a Container Is: Putting the App in a Shipping BoxI...
Nginx Round-Robin Load Balancing: Testing the Default Strategy and Its Boundaries
When Nginx acts as a reverse proxy, how to split traffic across multiple backends is the first question to answer. Round-Robin is the most basic answer: requests are handed to backends one by one in order, and when a cycle finishes, it starts over. It’s also Nginx’s default strategy — when the upstream block contains no load-balancing directive at all, round-robin is what you get. It’s simple enough to be taken for granted and never looked at twice. But under what distribution does round-robi...
A/B Testing and Canary Releases with the Nginx split_clients Module
Is the new homepage design really better than the old one? Dare you ship the new feature to everyone at once? A/B testing and canary releases are two phrasings of the same question: how to split traffic into groups by proportion, and do it stably. Nginx’s split_clients module (ngx_http_split_clients_module) handles this right at the access layer—hashing a user characteristic and slicing traffic by percentage, with no application code involved. This article is organized around hands-on co...
Nginx map Module in Practice: Replacing if Branches with Variable Mapping
It happens all the time when writing Nginx configs: one variable needs different handling depending on its value, and branching with a pile of ifs quickly makes the config unreadable — and Nginx’s if inside a location is infamous (IfIsEvil), full of behavioral traps. The map module exists for exactly this scenario: it derives the value of one variable from the value of another, with the mapping table written centrally in a map block where the logic is plain at a glance. This post verified fou...
Anti-Hotlinking and Temporary Links with the Nginx secure_link Module
Some resources cannot run naked on the public internet: paid-download files and time-limited shared archives all need “a valid credential to access”. Nginx’s secure_link module (ngx_http_secure_link_module) achieves this with URL signing — a request passes only if it carries the correct signature and an unexpired validity parameter; otherwise it’s rejected outright. Whether the signature checks out and how expiration is decided are easy to get wrong from the docs alone; this post tests everyt...
Nginx Referer Hotlink Protection in Practice: Four Kinds of Requests Tested Against valid_referers
Someone else’s page hotlinks your images with an <img> tag, and the bandwidth bill lands on you — that’s hotlinking. The Referer header in an HTTP request records which page the request jumped from, and Nginx’s Referer module (ngx_http_referer_module) uses that field to judge where a request came from: it can block hotlinks, and it can also log the origin for traffic analysis. The core mechanism in one sentence: valid_referers lists the legal origins; requests that don’t match flip the ...
The Nginx addition Module: Splicing Subrequest Content into the Main Response
Pages often carry small fragments served by separate endpoints — ad slots, footers, recommendation boxes. Letting the browser fetch them with extra requests drives up request counts and backend load. Nginx’s addition module offers another approach: at the Nginx layer, splice the subrequest’s response body in front of or behind the main response, so the client gets the complete content in a single request. This post runs through its configuration, boundaries, and one widely circulated outdated...
Replacing Content Before It's Returned: Nginx sub_filter
The backend code is inconvenient to change, but a certain domain or a certain sensitive word in the response simply must be swapped out — this kind of job is exactly what Nginx’s sub module (ngx_http_sub_module) is for: replacing designated strings in the content before the response goes back to the client. In reverse-proxy scenarios — domain migration, link rewriting, sensitive-word filtering — not one line of backend code gets touched. But the three high-frequency faceplants — “only the fir...
The Nginx Concat Module: Installing It and Merging Static Assets
When a page references a dozen-plus CSS/JS files, the browser has to fire a dozen-plus requests — the Concat module lets the server merge multiple files into one response, cutting both request count and network latency. It’s a third-party module from Alibaba’s Tengine family that stock Nginx doesn’t ship. This post compiles it for real inside a container following the original article’s installation approach, then live-tests its actual usage (?? URL merging), type constraints, and over-l...