检查是否存在/www/server/panel/vhost/nginx/0.site_total_log_format.conf
没有的话创建一个
内容为:
- log_format site_total escape=json '{'
- '"server_addr": "$server_addr",'
- '"server_port": $server_port,'
- '"host":"$http_host",'
- '"x_forwarded_for":"$http_x_forwarded_for",'
- '"x-real-ip":"$http_x_real_ip",'
- '"x-forwarded":"$http_x_forwarded",'
- '"forwarded-for":"$http_forwarded_for",'
- '"forwarded":"$http_forwarded",'
- '"true-client-ip":"$http_true_client_ip",'
- '"client-ip":"$http_client_ip",'
- '"ali-cdn-real-ip":"$http_ali_cdn_real_ip",'
- '"cdn-src-ip":"$http_cdn_src_ip",'
- '"cdn-real-ip":"$http_cdn_real_ip",'
- '"cf-connecting-ip":"$http_cf_connecting_ip",'
- '"x-cluster-client-ip":"$http_x_cluster_client_ip",'
- '"wl-proxy-client-ip":"$http_wl_proxy_client_ip",'
- '"proxy-client-ip":"$http_proxy_client_ip",'
- '"remote_addr":"$remote_addr",'
- '"remote_port":$remote_port,'
- '"remote_user":"$remote_user",'
- '"https":"$https",'
- '"req_length":$request_length,'
- '"method":"$request_method",'
- '"uri":"$request_uri",'
- '"request_filename":"$request_filename",'
- '"status":$status,'
- '"sent_bytes":$bytes_sent,'
- '"body_bytes_sent":$body_bytes_sent,'
- '"content_type":"$sent_http_content_type",'
- '"content_encoding":"$sent_http_content_encoding",'
- '"referer":"$http_referer",'
- '"user_agent":"$http_user_agent",'
- '"upstream_addr":"$upstream_addr",'
- '"upstream_status":$upstream_status,'
- '"upstream_response_time":$upstream_response_time,'
- '"take_time":$request_time,'
- '"msec":$msec,'
- '"cookie":"$http_cookie",'
- '"accept":"$http_accept",'
- '"accept_language":"$http_accept_language",'
- '"accept_encoding":"$http_accept_encoding"'
- '}';
复制代码 |