Skip to content
Artwork for Scalable Stories
Scalable Stories · September 25 · 10 min

NGINX Variables: Scope, Handlers, and Common Pitfalls

Technical Briefing: NGINX Variables — Semantics, Caching, and Scope The Problem NGINX variables look like scripting variables but do not behave like them. Three rules govern their behavior, and violating any of them produces either a startup failure or a silent, hard-to-diagnose bug: A variable must be introduced by a directive (set, map, geo) or exported by a module. Referencing anything else causes NGINX to refuse to start with nginx: [emerg] unknown "foo" variable. The name is global to the…

0:00-10:40

transcript

No transcript — this publisher did not publish one.

show notes

Technical Briefing: NGINX Variables — Semantics, Caching, and Scope The Problem NGINX variables look like scripting variables but do not behave like them. Three rules govern their behavior, and violating any of them produces either a startup failure or a silent, hard-to-diagnose bug: A variable must be introduced by a directive (set, map, geo) or exported by a module. Referencing anything else causes NGINX to refuse to start with nginx: [emerg] unknown "foo" variable. The name is global to the…