empty variable in access log
gfrankliu at gmail.com
Tue Dec 1 00:37:29 UTC 2020
If I understand correctly, the uninitialized custom variable is the same as
a variable initialized as "". That's why we don't see "-", but only see "".
Only internal variables will have the special "-" treatment.
On Mon, Nov 30, 2020 at 4:27 PM Maxim Dounin <mdounin at mdounin.ru> wrote:
> On Mon, Nov 30, 2020 at 03:26:59PM -0800, Frank Liu wrote:
> > ok, for testing, I removed the variable from the map, and add one line
> in a
> > 2-way SSL server config, to create a fresh new variable:
> > set $test_var "test";
> > For a request without client cert (400), I see neither "test", nor "-" in
> > the access log for $test_var. I only see blank, as if the $test_var was
> > to "".
> That's because variables defined due to "set" somewhere in the
> configuration default to "" with an optional warning
> (http://nginx.org/r/uninitialized_variable_warn). And in your
> test the variable is uninitialized, as the set directive is not
> executed for the request in question.
> The "-" special value can be seen for various builtin variables,
> such as non-existing headers ($http_*, $sent_http_*,
> $upstream_http_*), non-existing arguments ($arg_*), cookies
> ($cookie_*), $content_length if not available, $remote_user if not
> provided or empty, and so on.
> Maxim Dounin
> nginx mailing list
> nginx at nginx.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the nginx