申明:文章转摘自这里 http://gaojohn.blogchina.com/1257810.html 我仅仅是作为学习备份,感谢上面的作者; HTTP_CLIENT_IP:可通过http头伪造HTTP_X_FORWARDED_FOR:可通过http头伪造REMOTE_ADDR:可能是用户真实IP ...
分类:
其他好文 时间:
2016-04-21 10:18:52
阅读次数:
92
Nginx中日志文件的格式在nginx.conf中定义,其默认格式如下: #vim /usr/local/nginx/conf/nginx.conf log_format access ‘$remote_addr – $remote_user [$time_local] “$request” ‘‘$ ...
分类:
其他好文 时间:
2016-04-18 15:36:45
阅读次数:
165
1、修改Nginx日志格式:log_formatjson‘$remote_addr-$remote_user[$time_local]"$request"‘
‘$status$body_bytes_sent"$http_referer"‘
‘"$http_user_agent""$http_x_forwarded_for"‘;
access_log/data/nginx_logs/access.logjson;2、Nginx日志切割(shell脚本,略)3、安装G..
分类:
其他好文 时间:
2016-04-16 19:42:06
阅读次数:
340
题主说的这个很简单,主要注意三点 接收到的数据,用户名,密码 $_POST['name']; 获取ip地址:$_SERVER["REMOTE_ADDR"]; 保存到文件:file_put_contents('log.txt',$str); 示例代码 <?php //author blog.dxjsw ...
分类:
其他好文 时间:
2016-04-13 11:17:26
阅读次数:
136
由于客户反应web服务器访问有异常问题,查看监控并没有发现什么异常,但是还是有客户反应访问较慢,因此对nginx日志进行修改,在原日志格式中增加响应时间的配置。 日志格式: log_format main '$remote_addr - $remote_user [$time_local] "$re
分类:
其他好文 时间:
2016-03-23 16:55:02
阅读次数:
1216
$remote_addr是nginx与客户端进行TCP连接过程中,获得的客户端真实地址.RemoteAddress无法伪造,因为建立TCP连接需要三次握手,如果伪造了源IP,无法建立TCP连接,更不会有后面的HTTP请求X-Real-IP又是一个自定义头。X-Real-Ip通常被HTTP代理用来表示与它产生TCP连接的设备IP,..
分类:
其他好文 时间:
2016-03-09 07:09:17
阅读次数:
213
http://www.linuxidc.com/Linux/2011-07/38125.htmimg.xxxx.comnginxconfigTestadd_headerAccess-Control-Allow-Origin*;log_formatzuren‘$remote_addr-$remote_user[$time_local]‘‘$request_time$upstream_response_time"$request"‘‘$status$body_bytes_sent"$http_referer"‘‘..
分类:
其他好文 时间:
2016-03-02 20:15:53
阅读次数:
235
什么是remote_addrremote_addr代表客户端的IP,但它的值不是由客户端提供的,而是服务端根据客户端的ip指定的,当你的浏览器访问某个网站时,假设中间没有任何代理,那么网站的web服务器(Nginx,Apache等)就会把remote_addr设为你的机器IP,如果你用了某个代理,那么你的浏览..
分类:
其他好文 时间:
2016-03-01 16:04:06
阅读次数:
795
IP地址获得的五种方法: <?php //方法1: $ip = $_SERVER["REMOTE_ADDR"]; echo $ip; //方法2: $user_IP = ($_SERVER["HTTP_VIA"]) ? $_SERVER["HTTP_X_FORWARDED_FOR"] : $_SER
分类:
Web程序 时间:
2016-02-28 13:56:21
阅读次数:
248
<?php $getIp=$_SERVER["REMOTE_ADDR"]; echo 'IP:',$getIp; echo '<br/>'; $content = file_get_contents("http://api.map.baidu.com/location/ip?ak=7IZ6fgGEG
分类:
其他好文 时间:
2016-02-14 16:58:31
阅读次数:
227