AMH 社区首页
AMH社区 - 开放自由有价值的社区
[求助帖] Nginx日志中如何获取访客真实IP |
|
---|---|
新手求助 |
新手求助 发表于 2015-08-05 13:22:06
我用了阿里云的waf 访问日志里都是阿里的IP 根据这里的教程修改,还是不行: http://help.aliyun.com/knowledge_detail.htm?knowledgeId=5973903#nginx 现贴上我修改后的,请各位大大帮我看看是不是,我修改错了? include vhost/*.conf; server { listen 3000; server_name 106.21.204.156; index index.html index.htm index.php; root /home/wwwroot/index/web; if ( $host != '106.21.204.156' ) { return 400; } fastcgi_buffer_size 4k; fastcgi_buffers 8 4k; fastcgi_busy_buffers_size 4k; gzip off; location ~ .*\.php$ { fastcgi_pass unix:/tmp/php-cgi.sock; fastcgi_index index.php; include fcgi.conf; } location ~ .*\.(gif|jpg|jpeg|png|bmp)$ { expires 30d; } location ~ .*\.(js|css)?$ { expires 12h; } log_format combined '$remote_addr - $remote_user [$time_local] ' '"$request" $status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"' ; access_log /home/wwwroot/index/log/access.log combined; error_log /home/wwwroot/index/log/error.log crit; } 其中红色的就是添加的部分
点赞,加油! (0分)
2015-08-05 13:22:06 1
|