HTTP map directives

HTTP map directive

Defines a derived variable evaluated when used. Context: http. No default mapping block. Module availability depends on build. Partial HTTP configuration.

Formal Syntax & Structure

nginx syntaxnginx
map string $variable { ... }

Parameters & Attributes

NameTypeDescription
stringstringSource expression
$variablevariableName of result variable

Working Example

Example Snippetnginx
map $uri $page_kind {    default other;    /hello.txt greeting;}
Nginx Reference