Let's say an [upstream](https://nginx.org/en/docs/http/ngx_http_upstream_module.html), proxied by nginx, sets a cookie _foo=bar_ in its HTTP response. To use this cookie name as a variable in nginx configuration, use the magic prefix _$cookie\__ and the variable becomes _$cookie\_foo_. But how did a cookie become a variable? I call it a magic variable. It could also be called an arbitrary variable. nginx publishes its complete [list of variables](https://nginx.org/en/docs/varindex.html). Notice how some variables end in an underscore, which as of writing are, - [$arg_](https://nginx.org/en/docs/http/ngx_http_core_module.html#var_arg_) ([ngx_http_core_module](https://nginx.org/en/docs/http/ngx_http_core_module.html)) - [$cookie_](https://nginx.org/en/docs/http/ngx_http_core_module.html#var_cookie_) ([ngx_http_core_module](https://nginx.org/en/docs/http/ngx_http_core_module.html)) - [$http_](https://nginx.org/en/docs/http/ngx_http_core_module.html#var_http_) ([ngx_http_core_module](https://nginx.org/en/docs/http/ngx_http_core_module.html)) - [$jwt_claim_](https://nginx.org/en/docs/http/[ngx_http_auth_jwt_module](https://nginx.org/en/docs/http/ngx_http_auth_jwt_module.html).html#var_jwt_claim_) ([ngx_http_auth_jwt_module](https://nginx.org/en/docs/http/ngx_http_auth_jwt_module.html)) - [$jwt_header_](https://nginx.org/en/docs/http/[ngx_http_auth_jwt_module](https://nginx.org/en/docs/http/ngx_http_auth_jwt_module.html).html#var_jwt_header_) ([ngx_http_auth_jwt_module](https://nginx.org/en/docs/http/ngx_http_auth_jwt_module.html)) - [$sent_http_](https://nginx.org/en/docs/http/ngx_http_core_module.html#var_sent_http_) ([ngx_http_core_module](https://nginx.org/en/docs/http/ngx_http_core_module.html)) - [$sent_trailer_](https://nginx.org/en/docs/http/ngx_http_core_module.html#var_sent_trailer_) ([ngx_http_core_module](https://nginx.org/en/docs/http/ngx_http_core_module.html)) - [$upstream_cookie_](https://nginx.org/en/docs/http/ngx_http_upstream_module.html#var_upstream_cookie_) ([ngx_http_upstream_module](https://nginx.org/en/docs/http/ngx_http_upstream_module.html)) - [$upstream_http_](https://nginx.org/en/docs/http/ngx_http_upstream_module.html#var_upstream_http_) ([ngx_http_upstream_module](https://nginx.org/en/docs/http/ngx_http_upstream_module.html)) - [$upstream_trailer_](https://nginx.org/en/docs/http/ngx_http_upstream_module.html#var_upstream_trailer_) ([ngx_http_upstream_module](https://nginx.org/en/docs/http/ngx_http_upstream_module.html)) These are variable name prefixes (for want of a better terminology). Their respective modules create magic or arbitrary variables from the suffix, which has a special meaning to the module. In our example, the cookie name _foo_ becomes the suffix which ngx_http_core_module uses to create the variable _$cookie\_foo_. We don't have to explicitly create or set this variable; it is available for us to use. Both _$upstream\_header\_time_ and _$upstream\_http\_server_ are examples of embedded variables (provided by ngx_http_upstream_module). Since _$upstream\_http\__ is in our list above, it is an embedded and a magic (arbitrary) variable. The "magic" part comes from the suffix _server_ which is the value from the HTTP response header, _Server_. Meanwhile, _$upstream\_header\_time_ is only an embedded variable. Read the official documentation for more information.