empty user-agent and logs

Francis Daly francis at daoine.org
Thu Sep 14 21:57:07 UTC 2017

On Thu, Sep 14, 2017 at 10:57:39PM +0300, Christos Chatzaras wrote:

Hi there,

> xxx.xxx.xxx.xxx - - [14/Sep/2017:22:47:09 +0300] "GET /index.php HTTP/1.1" 200 26039 "-" "-"
> There is not difference if there is an empty user-agent or a user-agent with a dash.
> Any idea it shows the empty user agents with dash?

In the "common log format" widely used by web servers, the "hyphen" in the
output indicates that the requested piece of information is not available.

nginx does this in the function ngx_http_log_variable() in the file
src/http/modules/ngx_http_log_module.c. If the difference between empty
and dash matters to you, that is where you would probably change it.

Francis Daly        francis at daoine.org

More information about the nginx mailing list