上线了建站价格,企业网站 用个人备案,北京大型网站建设公司,以网站和什么为重点建设平台nginx服务器日志相关指令主要有两条#xff0c;一条是log_format#xff0c;用来设置日志格式#xff0c;另外一条是access_log#xff0c;用来指定日志文件的存放路径、格式和缓存大小#xff0c;一般在nginx的配置文件中日记配置(/usr/local/nginx/conf/nginx.conf)。 n… nginx服务器日志相关指令主要有两条一条是log_format用来设置日志格式另外一条是access_log用来指定日志文件的存放路径、格式和缓存大小一般在nginx的配置文件中日记配置(/usr/local/nginx/conf/nginx.conf)。 nginx的log_format有很多可选的参数用于指示服务器的活动状态默认的是log_format access $remote_addr - $remote_user [$time_local] $request $status $body_bytes_sent $http_referer $http_user_agent $http_x_forwarded_for; 想要记录更详细的信息需要自己设置log_format具体可设置的参数格式及说明如下 参数说明示例$remote_addr客户端地址211.28.65.253$remote_user客户端用户名称--$time_local访问时间和时区18/Jul/2012:17:00:01 0800$request请求的URI和HTTP协议GET /article-10000.html HTTP/1.1$http_host请求地址即浏览器中你输入的地址IP或域名192.168.100.100$statusHTTP请求状态200$upstream_statusupstream状态200$body_bytes_sent发送给客户端文件内容大小1547$http_refererurl跳转来源https://www.baidu.com/$http_user_agent用户终端浏览器等信息Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; SV1; GTB7.0; .NET4.0C;$ssl_protocolSSL协议版本TLSv1$ssl_cipher交换数据中的算法RC4-SHA$upstream_addr后台upstream的地址即真正提供服务的主机地址10.10.10.100:80$request_time整个请求的总时间0.205$upstream_response_time请求过程中upstream响应时间0.002