If you're running a virtual host style environment (with multiple server blocks) with NGINX, there's one small tweak you can make to enhance the logs. By default, the host (defined as $host) isn't logged when using the default combined format. Having this field in the logs means that the log can be parsed externally without the need for additional information.
Virtual host log format
How to do it...
To start with, we need to define our new log format:
log_format vhostlogs '$host $remote_addr - $remote_user ' '[$time_local] "$request" $status ' '$body_bytes_sent "$http_referer" ' '"...