nginx using uninitialized “XXXX” variable while logging request

background

Recently, when checking nginx’s log, I found a very strange log, so I tried my best to check it.

Error log:

Nginx.conf configuration:

Trigger condition:

visit: http://localhost:8907/logo After that, the log of using uninitialized “XXXX” variable while logging request will be recorded in the error log

reason

Although the variables set by set are global variables, if there is no assignment to the global variables set by set in each location, they are also undefined variables. If used, a warning will be triggered.

Similar Posts: