empty variable in access log

Frank Liu gfrankliu at gmail.com
Mon Nov 30 22:04:35 UTC 2020


I may have mixed this with special upstream variables, eg:
$upstream_http_something. When upstream response header doesn't existing,
the variable was logged - in the nginx access logs.

On Mon, Nov 30, 2020 at 5:28 AM Maxim Dounin <mdounin at mdounin.ru> wrote:

> Hello!
>
> On Sun, Nov 29, 2020 at 05:35:19AM -0800, Frank Liu wrote:
>
> > If I create a variable, default to blank:
> >
> >    map upstream_env $upstream_env {
> >        default "";
> >    }
> >
> > and log it in access log (log_format has $upstream_env). I see a "-" in
> the
> > log file, which is as expected, but for a 2-way SSL virtual host, I don't
> > see the "-", just blank. Is that a bug?
>
> The above snippet is expected to always result in "", as the above
> variable has the value "".  If it results in "-" being logged for
> you, this is certainly not something expected, please share full
> configuration which demonstrates the problem.
>
> --
> Maxim Dounin
> http://mdounin.ru/
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20201130/07bdc2ec/attachment.htm>


More information about the nginx mailing list