- 进入nginx安装目录
cd /usr/local/nginx/ - vi nginx.conf
log_format lvan ‘$remote_addr - $remote_user [$time_iso8601] "$request" $http_host ‘
‘$status $body_bytes_sent "$http_referer" ‘
‘"$http_user_agent" $http_x_forwarded_for ‘
‘"$upstream_addr" $upstream_status "$upstream_cache_status" "$upstream_http_content_type" $upstream_response_time "$request_time" $request_length $bytes_sent $server_name‘; -
检查nginx状态
/usr/local/nginx/sbin/nginx -t - 重新加载nginx
/usr/local/nginx/sbin/nginx -s reload - 查看新的访问日志
tail -100f /var/log/nginx/mqpublish.iapi.ymatou.com.log
时间: 2024-11-07 14:04:42