function checkDevice(){ ...
分类:
其他好文 时间:
2016-12-12 19:33:16
阅读次数:
502
#全局配置
limit_req_zone$anti_spiderzone=anti_spider:10mrate=15r/m;
#某个server中
limit_reqzone=anti_spiderburst=30nodelay;
if($http_user_agent~*"xxspider|xxbot"){
set$anti_spider$http_user_agent;
}超过设置的限定频率,就会给spider一个503。上述配置详细解释..
分类:
其他好文 时间:
2016-12-06 04:34:05
阅读次数:
173
import reimport urllib2headers = {'User-agent' : 'Mozilla/5.0 (Windows NT 6.2; WOW64; rv:22.0) Gecko/20100101 Firefox/22.0'}with open('C:\\Users\\yaxi ...
分类:
编程语言 时间:
2016-12-03 17:58:02
阅读次数:
275
参考:http://www.cnblogs.com/dunitian/p/5218140.html 简单点,直接上用法 新建MVC项目,在golbal.asax中添加如下代码 新建一个view,增加iphone.cshtml为后缀的文件 那么如果user-agent中包含iphone,就会打开该页面 ...
分类:
移动开发 时间:
2016-12-03 12:40:27
阅读次数:
202
禁止非法恶意访问的IP[root@LNMP~]#vim/usr/local/nginx/conf/vhosts/linux.conflocation~.*admin\.php${allow127.0.0.1;denyall;#auth_basic"auth";#auth_basic_user_file/usr/local/nginx/conf/.htpasswd;includefastcgi_params;fastcgi_passunix:/tmp/dis.sock;fastcgi_inde..
分类:
其他好文 时间:
2016-12-03 02:42:31
阅读次数:
191
在主配置文件中已经定义了配置文件的格式[root@LNMP~]#vim/usr/local/nginx/conf/nginx.conf#nginx中的配置修改日志命名格式log_formatcombined_realip‘$remote_addr$http_x_forwarded_for[$time_local]‘‘$host"$request_uri"$status‘‘"$http_referer""$http_user_agent"‘;$rem..
分类:
其他好文 时间:
2016-12-01 22:57:34
阅读次数:
2230
<?php function isMobile(){ $useragent=isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : ''; $useragent_commentsblock=preg_match('|.?? ...
分类:
移动开发 时间:
2016-11-28 08:27:37
阅读次数:
204
用python+bs4爬取了手机归属地数据: import urllib.request from bs4 import BeautifulSoup def spider1(url): headers = {'User-Agent':'Mozilla/5.0 (Windows NT 6.1) App ...
分类:
移动开发 时间:
2016-11-25 17:28:06
阅读次数:
256
360的兼容模式用的是IE、极速模式用的是chrom的内核 1. 、User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/53 ...
分类:
其他好文 时间:
2016-11-19 01:26:53
阅读次数:
165