①开启日志的定义规则
#定义日志格式 定义http里
log_format mylogs '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
②调用规则
#访问日志的存储路径配置 调用的日志格式
#在server段里面配置 也就是在当前server里的访问日志,会被写入定义的这里
access_log logs/shop.lnmp.com_access.log mylogs;
#开启日志 #存放路径 #调用格式