··默认值default:log_format main '...' //main时日志的格式名称 log_format main'$remote_addr - $remote_user [$time_local] "$request"''$status $body_bytes_sent "$http_referer"''"$http_user_agent" "$http_x_forwarded_for"'; access_log/var/log/nginx/access.logmain; //access_log日...
log_format main '$remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent"'; 这里我添加了$status(HTTP响应状态码)和$body_bytes_sent(发送给客户端的字节数,不包括响应头的大小)等常用变量,以及$http_referer和$http_user_agent,分别表示...
log_format main'$remote_addr $remote_user [$time_local] "$request" ''$status $body_bytes_sent "$http_referer" ''$http_user_agent $http_x_forwarded_for $request_time $upstream_response_time $upstream_addr $upstream_status'; 然后在nginx.conf文件或vhosts/*.conf文件中的access_log日志中指定...
log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; 想要记录更详细的信息需要自定义设置log_format,具体可设置的参数格式及说明如下: 1 2 3 4 5 6 7 8 9 10 11 12 13...
log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; ...
1. 默认格式: log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; 1. 2. 3. (1). 参数说明: |参数|说明| |---|---|---| | ...
log_format main'$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; 想要记录更详细的信息需要自定义设置log_format,具体可设置的参数格式及说明如下: ...
log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"' ; 想要记录更详细的信息需要自定义设置log_format,具体可设置的参数格式及说明如下: 1 2 3 4 5 6 7 8 9 10 11 ...
1、log_format 用来设置日志格式 log_format中的指令是不能重复的 2、access_log 用来指定日志的存放路径、格式、缓存大小 log_format语法 log_format name format{format...}默认设置为 log_format main'$remote_addr - $remote_user [$time_local] "$request" ''$status $body_bytes_sent "$http_referer...
log_format main '$server_name $remote_addr - $remote_user [$time_local] "$request"' '$status $uptream_status $body_bytes_sent "$http_referer"' '"$http_user_agent" "$http_x_forwarded_for" ' '$ssl_protocol $ssl_cipher $upstream_addr $request_time $upstream_response_time'; ...