日誌模塊的說明
日誌的默認路徑:error_log /var/log/nginx/error.log warn; warn是指日誌的等級,一般有debug, info, notice, warn, error, crit。
access_log /var/log/nginx/access.log main; main是指訪問日誌記錄的格式信息,在http模塊中
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
Nginx日誌變量:
http請求變量(request):arg_PARAMETER()、http_HEADER、sent_http_HEADER(服務端返回客戶端response)
內置變量:Nginx內置變量 官網有說明
自定義變量:自己定義的變量