{"record":{"id":"9ebcae6f970ef02c","repo":"nginx/nginx","slug":"ngx-log-emerg-9ebcae","errorCode":"NGX_LOG_EMERG","errorMessage":"invalid variable name \\\"$\\\"","messagePattern":"invalid variable name \\\\\"\\$\\\\\"","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/http/ngx_http_variables.c","lineNumber":434,"sourceCode":"    ngx_http_variable(\"\");\nngx_http_variable_value_t  ngx_http_variable_true_value =\n    ngx_http_variable(\"1\");\n\n\nstatic ngx_uint_t  ngx_http_variable_depth = 100;\n\n\nngx_http_variable_t *\nngx_http_add_variable(ngx_conf_t *cf, ngx_str_t *name, ngx_uint_t flags)\n{\n    ngx_int_t                   rc;\n    ngx_uint_t                  i;\n    ngx_hash_key_t             *key;\n    ngx_http_variable_t        *v;\n    ngx_http_core_main_conf_t  *cmcf;\n\n    if (name->len == 0) {\n        ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,\n                           \"invalid variable name \\\"$\\\"\");\n        return NULL;\n    }\n\n    if (flags & NGX_HTTP_VAR_PREFIX) {\n        return ngx_http_add_prefix_variable(cf, name, flags);\n    }\n\n    cmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_core_module);\n\n    key = cmcf->variables_keys->keys.elts;\n    for (i = 0; i < cmcf->variables_keys->keys.nelts; i++) {\n        if (name->len != key[i].key.len\n            || ngx_strncasecmp(name->data, key[i].key.data, name->len) != 0)\n        {\n            continue;\n        }\n","sourceCodeStart":416,"sourceCodeEnd":452,"githubUrl":"https://github.com/nginx/nginx/blob/3f6f7824d4e2eb1ac37dec76683d525ac0ff521c/src/http/ngx_http_variables.c#L416-L452","documentation":"Error \"invalid variable name \\\"$\\\"\" thrown in nginx/nginx.","triggerScenarios":"Thrown at src/http/ngx_http_variables.c:434 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3f6f7824d4e2eb1ac37dec76683d525ac0ff521c","analyzedAt":"2026-08-22T03:09:46.447Z","schemaVersion":2},"datasetVersion":"2026-08-22T04:17:13.399Z"}