nginx/nginx · error
NGX_LOG_EMERG
NGX_LOG_EMERG
Error message
invalid variable name \"$\"
What it means
Error "invalid variable name \"$\"" thrown in nginx/nginx.
Source
Thrown at src/http/ngx_http_variables.c:434
ngx_http_variable("");
ngx_http_variable_value_t ngx_http_variable_true_value =
ngx_http_variable("1");
static ngx_uint_t ngx_http_variable_depth = 100;
ngx_http_variable_t *
ngx_http_add_variable(ngx_conf_t *cf, ngx_str_t *name, ngx_uint_t flags)
{
ngx_int_t rc;
ngx_uint_t i;
ngx_hash_key_t *key;
ngx_http_variable_t *v;
ngx_http_core_main_conf_t *cmcf;
if (name->len == 0) {
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
"invalid variable name \"$\"");
return NULL;
}
if (flags & NGX_HTTP_VAR_PREFIX) {
return ngx_http_add_prefix_variable(cf, name, flags);
}
cmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_core_module);
key = cmcf->variables_keys->keys.elts;
for (i = 0; i < cmcf->variables_keys->keys.nelts; i++) {
if (name->len != key[i].key.len
|| ngx_strncasecmp(name->data, key[i].key.data, name->len) != 0)
{
continue;
}
View on GitHub (pinned to 3f6f7824d4)
When it happens
Trigger: Thrown at src/http/ngx_http_variables.c:434 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of nginx/nginx@3f6f7824d4 (2026-08-22).
Data as JSON: /api/errors/9ebcae6f970ef02c.
Report an issue: GitHub.