omotam img

Skip to main content
  1. Posts/

Nginx Logging Configurations

··45 words·1 min·

Format #

Combined #

This is the default log format in Nginx.
log_format combined '$remote_addr - $remote_user [$time_local] '
                    '"$request" $status $body_bytes_sent '
                    '"$http_referer" "$http_user_agent"';

Vhost Combined #

log_format vhost_combined '$host $remote_addr - $remote_user [$time_local] '
                          '"$request" $status $body_bytes_sent '
                          '"$http_referer" "$http_user_agent"';

access_log /var/log/nginx/access.log vhost_combined;
error_log  /var/log/nginx/error.log;