# When using http://nginx.org/en/docs/http/ngx_http_realip_module.html # (Could use $host instead of $server_name to log vhost aliases separately) # See https://serverfault.com/a/744150/158759 log_format realip_combined '$realip_remote_addr ($remote_addr) $remote_user [$time_local] ' '"$request" $status $body_bytes_sent ' '"$http_referer" "$http_user_agent"'; log_format vhost_realip_combined '$server_name $realip_remote_addr ($remote_addr) $remote_user [$time_local] ' '"$request" $status $body_bytes_sent ' '"$http_referer" "$http_user_agent"'; # Define an access log for VirtualHosts that don't define their own logfile ## access_log /var/log/nginx/other_vhosts_access.log vhost_realip_combined;