記錄nginx轉(zhuǎn)發(fā)到某臺(tái)機(jī)器日志 (2011-12-20 15:06:14)
僅貼一些關(guān)鍵的配置: log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"' '"$upstream_addr"' '"$upstream_response_time"';
upstream hudong { server 172.16.96.202:8080; server 172.16.96.203:80; }
從負(fù)載上觀察日志: 172.16.96.245 - - [20/Dec/2011:15:44:29 +0800] "GET / HTTP/1.1" 200 154 "-" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C)" "-""172.16.96.203:80""0.000" 172.16.96.245 - - [20/Dec/2011:15:44:29 +0800] "GET / HTTP/1.1" 200 154 "-" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C)" "-""172.16.96.202:8080""0.000"
|