openresty / openresty/lua-nginx-module

NGINX set variable not working

Open
#2,056 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
11.8k
Forks
2.1k
Avg merge
6h 1m
Merged PRs (30d)
6

Description

I have already set the variable start_time in my nginx config but somehow that variable is not getting picked up in access_log. We have so many variables set the same way and everything else works.

set $start_time ' ';

2022/06/10 14:45:18 [error] 43558#43558: *13295093 lua entry thread aborted: runtime error: /apps_01/apigw/etc/nginx/lua/something.lua:40: variable "start_time" not found for writing; maybe it is a built-in variable that is not changeable or you forgot to use "set $start_time '';" in the config file to define it first
stack traceback:

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the NGINX configuration containing set $start_time and the Lua code at /apps_01/apigw/etc/nginx/lua/something.lua:40, then reproduce the variable access with a minimal configuration. Done means the variable is available to the Lua code and is recorded by access_log without the reported runtime error.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua, nginx
Domain
infrastructure
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.