I have a question about how 301 entries are logged. A bit of background:
I created a new Ubuntu/Nginx server and added a site. By default, NGINX logs to /var/log/nginx/access.log
I edited one site conf log to its own file::
error_log /var/log/nginx/www.foo.com-error.log error;
access_log /var/log/nginx/www.foo.com-access.log;
The site logs successfully, except that 301 entries are still being logged in the default access log.
For example:
This record:
06/Dec/2019:16:54:28 +0000 - 111.111.111.111 - www.foo.com - GET / HTTP/1.1 - 301 - 169 - - - Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36 Edge/18.18362 - 111.111.111.111
Is being logged to /var/log/nginx/access.log
instead of /var/log/nginx/www.foo.com-access.log
I'd like to do two things, but I don't know how:
Make sure that anything related to foo.com is being logged to the foo.com-access file including 301 entries.
Add a field to the
log_format
that shows where the request is redirecting to (not just the referrer from) in the log.
Can anyone help with this?
Thanks!
0 Answers