Skip to content
Artwork for Scalable Stories
Scalable Stories · September 26 · 11 min

NGINX Accept-Language Redirects: No Lua Required

Technical Briefing: NGINX Accept-Language Module — Header-Based Language Detection The Problem Stock NGINX cannot parse the Accept-Language header. Language-based redirects therefore typically require a map block full of regexes, an njs script, or a full OpenResty/Lua layer. Real headers are messy: fr-CH, fr;q=0.9, en;q=0.8, de;q=0.7, ;q=0.5 They include regional subtags, quality values, spaces, and wildcards — all painful to match correctly. The Fix The NGINX Accept-Language module provides a…

0:00-11:38

transcript

No transcript — this publisher did not publish one.

show notes

Technical Briefing: NGINX Accept-Language Module — Header-Based Language Detection The Problem Stock NGINX cannot parse the Accept-Language header. Language-based redirects therefore typically require a map block full of regexes, an njs script, or a full OpenResty/Lua layer. Real headers are messy: fr-CH, fr;q=0.9, en;q=0.8, de;q=0.7, ;q=0.5 They include regional subtags, quality values, spaces, and wildcards — all painful to match correctly. The Fix The NGINX Accept-Language module provides a…