Browse Source

Include Host or SERVER_NAME in logs

Mike Dillon 10 năm trước cách đây
mục cha
commit
ac1f2d8875
1 tập tin đã thay đổi với 5 bổ sung1 xóa
  1. 5 1
      nginx.tmpl

+ 5 - 1
nginx.tmpl

@@ -14,7 +14,11 @@ map $http_upgrade $proxy_connection {
 
 gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
 
-access_log /proc/self/fd/1;
+log_format vhost '$host $remote_addr - $remote_user [$time_local] '
+                 '"$request" $status $body_bytes_sent '
+                 '"$http_referer" "$http_user_agent"';
+
+access_log /proc/self/fd/1 vhost;
 error_log /proc/self/fd/2;
 
 # HTTP 1.1 support