Empty /error log lines (a lot of them)

Mit Rowe mit at stagename.com
Wed Jan 4 18:27:34 UTC 2012

On Wed, Jan 4, 2012 at 2:03 AM, Cabbar Duzayak <cabbar at gmail.com> wrote:

> Hi,

> Can we at least tell Nginx not to log these? Something like, if there
> is no http method / url, skip the log?

It's very likely that there's no Host header sent, so it's being directed
to the server set as "default".

In my setup i define a server{} section for every real host, and then add a
separate "catch all" one for everything else and turn off the logs when not
If you are able to do something similar, it should capture those spurious
connections, direct them to the default host, and not log the lines

#catch all
    server {
        listen 80 default_server;
        server_name localhost.domain.com localhost xx.xx.xx.xx;
#where xx.xx.xx.xx is the local IP
        access_log off;
        location / {
            #office router
            allow xx.xx.xx.xx;
            deny all;

#real server(s)
   server {
      access_log /var/log/nginx/access.log;
      listen 80;
      server_name .domain.com; #matches www.domain.com and domain.com
     location / {

Will 'Mit' Rowe
mit at stagename.com <josh at stagename.com>
Twitter: @stagename

*The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of this
information by persons or entities other than the intended recipient is
prohibited. If you received this transmission in error, please contact the
sender and delete all material contained herein from your computer.*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20120104/5de8c352/attachment.html>

More information about the nginx mailing list