The snippet below outputs a verbose version of the nginx access log
To use it, simply copy the contents of verbose-access.conf
and paste it into your http block.
make sure to remove / comment out any existing access_log definitions such as access_log /var/log/nginx/access.log;
Example output:
Timestamp: 22/May/2018:09:49:01 +0000
Matched Server: localhost
Protocol: HTTP/1.1
IP (server): 172.20.0.7
IP (remote): 172.20.0.1
Port: 80
Status: 200
Request: GET / HTTP/1.1
Requested URI: /
URI: /index.php
Query Args: -
Request Body: -
Request Body File: -
Request Filename: /var/www/html/index.php
Realpath Root: /var/www/html
Final File: /var/www/html/index.php
## Misc
Remote User: -
Referrer -
User Agent Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36
Forwarded for -
## cache
===============================================================================