http請求
主要涉及客戶端和服務端
request----包括請求行、請求頭部、請求數據
response----包括狀態行、消息報頭、響應正文
模擬一個請求使用crul命令 使用-v 展現相關的請求格式
日志類型
包括error.log、access_log
log_format
Syntax:log_format name [escape = default |json| string ...;
Default:log_format combined "......"
Context :http
error_log
nginx的錯誤日志以及錯誤級別
access_log
訪問日志文件路徑,格式及相關的緩沖配置
可以在文件的路徑中進行查看相關打印
Nginx變量
Http請求變量 -arg_PARAMETER、http_HEADER、sent_http_HEADER
內置變量
自定義變量
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
remote_addr :IP地址、 request:http請求相關信息
status:responsed響應信息 body_bytes_sent:body信息大小 h
http_referer:上一級頁面 http_user_agent:標准的http頭信息(客戶端的內容)
$http_x_forwarded_for:標准的頭,記錄每一個用戶請求所攜帶的http信息