日志模块的说明
日志的默认路径: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内置变量 官网有说明
自定义变量:自己定义的变量