标签:
日志格式
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 main1 ‘$proxy_add_x_forwarded_for - $remote_user [$time_local] ‘
‘"$request" $status $body_bytes_sent ‘
‘"$http_referer" "$http_user_agent"‘; //此日志格式为,ip不仅记录代理的ip还记录远程客户端真实IP。
在nginx虚拟主机中分别用main main1 引用即可。
标签:
原文地址:http://www.cnblogs.com/lin1/p/5672214.html