标签:style blog color io div sp cti on c
先把代码贴在这里,有时间整理
if(r->headers_in.x_real_ip != NULL) { ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, "%V", &r->headers_in.x_real_ip->value); } else { sockaddr_in *sin = (sockaddr_in*)(r->connection->sockaddr); ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, "%s", inet_ntoa(sin->sin_addr)); }
标签:style blog color io div sp cti on c
原文地址:http://www.cnblogs.com/zuohongming/p/3988350.html