Nginx not logging access

It does seem to be logging some access (on my local network and then
looping back in from my router’s IP), but I’m not seeing access from
someone external to my house. I can see that a connection exists in
netstat, I can see my transmitted bytes incrementing when I look at
eth0, but nginx has failed to log this to the access.log. Obfuscations
were made to protect the innocent.

Here is netstat:

tcp 0 197100 home-srv.local:8000 ip1-2-3-5.aj.:52927
ESTABLISHED

Here you can see eth0 tx incrementing (pulled within a second of each
other):

[email protected]:/var/log# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 48:5b:39:86:b0:09
inet addr:192.168.1.10 Bcast:192.168.1.255
Mask:255.255.255.0
inet6 addr: fe80::4a5b:39ff:fe86:b009/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:367829 errors:0 dropped:0 overruns:0 frame:0
TX packets:481053 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:26445268 (26.4 MB) TX bytes:707235638 (707.2 MB)
Interrupt:41 Base address:0x6000

[email protected]:/var/log# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 48:5b:39:86:b0:09
inet addr:192.168.1.10 Bcast:192.168.1.255
Mask:255.255.255.0
inet6 addr: fe80::4a5b:39ff:fe86:b009/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:367948 errors:0 dropped:0 overruns:0 frame:0
TX packets:481279 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:26453570 (26.4 MB) TX bytes:707562874 (707.5 MB)
Interrupt:41 Base address:0x6000

And here you can see nginx has not logged any file access today. This
is where the log ends, I have not accessed the server today.
99.99.99.99 was my wife accessing the URL I sent her for this file she
was trying to get to her friend, she clicked the link I emailed her,
which was to our external IP on port 8000 (residential VDSL, incoming 80
is blocked).

192.168.1.104 - - [27/Oct/2011:22:46:34 -0500] “GET / HTTP/1.1” 200 133
“-” “Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20100101
Firefox/8.0”
192.168.1.104 - - [27/Oct/2011:22:46:34 -0500] “GET /favicon.ico
HTTP/1.1” 200 133 “-” “Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0)
Gecko/20100101 Firefox/8.0”
192.168.1.104 - - [27/Oct/2011:22:46:34 -0500] “GET /favicon.ico
HTTP/1.1” 200 133 “-” “Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0)
Gecko/20100101 Firefox/8.0”
192.168.1.104 - - [27/Oct/2011:22:50:27 -0500] “GET /file.zip HTTP/1.1”
200 194826552 “-” “Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0)
Gecko/20100101 Firefox/8.0”
192.168.1.104 - - [27/Oct/2011:22:53:52 -0500] “GET /file.zip HTTP/1.1”
200 154165552 “-” “Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0)
Gecko/20100101 Firefox/8.0”
99.99.99.99 - - [27/Oct/2011:22:58:42 -0500] “GET /file.zip HTTP/1.1”
200 24232852 “-” “Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1)
Gecko/20100101 Firefox/7.0.1”

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,217477,217477#msg-217477

I just noticed that after the user’s download was complete, the
access.log was updated. Not sure I particularly like that
behavior…I’d prefer to have it logged when contact is initiated.

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,217477,217483#msg-217483

Ok, guess I’ve just never noticed this with Apache or lighttpd. It
would be nice to have a config option to log on-access instead, but I
appreciate the info.

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,217477,217494#msg-217494

Hello!

On Fri, Oct 28, 2011 at 03:33:13PM -0400, cob wrote:

I just noticed that after the user’s download was complete, the
access.log was updated. Not sure I particularly like that
behavior…I’d prefer to have it logged when contact is initiated.

Typical behaviour of http servers (and nginx isn’t an exception) is
to log request once response is sent.

With current state of http as used for almost everything,
including long streaming and so on, it’s probably good idea to
have an option to log request once it’s got from client. Though
it’s not something we currently have.

Maxim D.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs