1. 程式人生 > >Nginx日誌_log_format預設引數解釋

Nginx日誌_log_format預設引數解釋

Nginx日誌_log_format預設引數解釋

Linux模擬HTTP請求:

[[email protected]_0_2_centos nginx]# curl http://localhost?wd=wwl\&lover=xq

 

access.log:

127.0.0.1 - - [10/Dec/2018:20:06:48 +0800] "GET /?wd=wwl&lover=xq HTTP/1.1" 200 635 "-" "curl/7.29.0" "-" "wwl"-"wd=wwl&lover=xq"-"-"-"-"-"localhost"-"Sat, 08 Dec 2018 04:13:40 GMT"

(1)$remote_addr

       客戶端請求地址:127.0.0.1 - - [10/Dec/2018:20:06:48 +0800] "GET /?wd=wwl&lover=xq HTTP/1.1" 200 635 "-" "curl/7.29.0" "-" "wwl"-"wd=wwl&lover=xq"-"-"-"-"-"localhost"-"Sat, 08 Dec 2018 04:13:40 GMT"

(2)$remote_user

客戶端請求驗證的使用者名稱:這裡沒有,空

127.0.0.1 - - [10/Dec/2018:20:06:48 +0800] "GET /?wd=wwl&lover=xq HTTP/1.1" 200 635 "-" "curl/7.29.0" "-" "wwl"-"wd=wwl&lover=xq"-"-"-"-"-"localhost"-"Sat, 08 Dec 2018 04:13:40 GMT"

(3)$time_local

       本地時間:127.0.0.1 - - [10/Dec/2018:20:06:48 +0800] "GET /?wd=wwl&lover=xq HTTP/1.1" 200 635 "-" "curl/7.29.0" "-" "wwl"-"wd=wwl&lover=xq"-"-"-"-"-"localhost"-"Sat, 08 Dec 2018 04:13:40 GMT"

(4)$request

       完整的原始請求行:127.0.0.1 - - [10/Dec/2018:20:06:48 +0800] "GET /?wd=wwl&lover=xq HTTP/1.1"

200 635 "-" "curl/7.29.0" "-" "wwl"-"wd=wwl&lover=xq"-"-"-"-"-"localhost"-"Sat, 08 Dec 2018 04:13:40 GMT"

(5)$status

       服務端響應的狀態碼:127.0.0.1 - - [10/Dec/2018:20:06:48 +0800] "GET /?wd=wwl&lover=xq HTTP/1.1" 200 635 "-" "curl/7.29.0" "-" "wwl"-"wd=wwl&lover=xq"-"-"-"-"-"localhost"-"Sat, 08 Dec 2018 04:13:40 GMT"

(6)$body_bytes_sent

       服務端返回給客戶端位元組大小:127.0.0.1 - - [10/Dec/2018:20:06:48 +0800] "GET /?wd=wwl&lover=xq HTTP/1.1" 200 635 "-" "curl/7.29.0" "-" "wwl"-"wd=wwl&lover=xq"-"-"-"-"-"localhost"-"Sat, 08 Dec 2018 04:13:40 GMT"

(7)$http_referer

       告訴服務端我是從哪個頁面連結過來的:127.0.0.1 - - [10/Dec/2018:20:06:48 +0800] "GET /?wd=wwl&lover=xq HTTP/1.1" 200 635 "-" "curl/7.29.0" "-" "wwl"-"wd=wwl&lover=xq"-"-"-"-"-"localhost"-"Sat, 08 Dec 2018 04:13:40 GMT"

(8)$http_user_agent

       請求的具體客戶端是什麼(IE、Chrome、FireFox等):127.0.0.1 - - [10/Dec/2018:20:06:48 +0800] "GET /?wd=wwl&lover=xq HTTP/1.1" 200 635 "-" "curl/7.29.0" "-" "wwl"-"wd=wwl&lover=xq"-"-"-"-"-"localhost"-"Sat, 08 Dec 2018 04:13:40 GMT"

(9)$http_x_forwarded_for

       客戶端請求的真實IP,如果代理存在,即有值,否則沒值:127.0.0.1 - - [10/Dec/2018:20:06:48 +0800] "GET /?wd=wwl&lover=xq HTTP/1.1" 200 635 "-" "curl/7.29.0" "-" "wwl"-"wd=wwl&lover=xq"-"-"-"-"-"localhost"-"Sat, 08 Dec 2018 04:13:40 GMT"