toxic

备忘录

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

2013年10月9日

摘要: user nobody;worker_processes 1;error_log logs/error.log;#error_log logs/error.log notice;#error_log logs/error.log info;#pid logs/nginx.pid;events { use epoll; #epoll是多路复用IO worker_connections 1024;}http { include mime.types; default_type application/octet-stream... 阅读全文
posted @ 2013-10-09 16:21 toxic 阅读(8439) 评论(0) 推荐(0) 编辑

摘要: D10-Nginx-http_user_agentNginx 有许多内置变量,其中的$http_user_agent代表客户端浏览器的UA ( User Agent)信息。1 正常的nginx 日志//windows xp1(IE6)10.0.100.82 - - [10/Aug/2012:10:26:12 +0800] "GET / HTTP/1.1"2006764 "-""Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET CLR 阅读全文
posted @ 2013-10-09 15:47 toxic 阅读(1920) 评论(0) 推荐(0) 编辑

摘要: 以下为字符串匹配操作符:~为区分大小写匹配~* 为不区分大小写匹配!~和!~*分别为区分大小写不匹配及不区分大小写不匹配1: 限制某些类型的客户端的访问view plainprint?location/{if($http_user_agent~MSIE){return503;}}#限制IE访问如果把MSIE改成 Mozilla 就基本上把IE和firefox这样pc浏览器限制了2和3主要是针对盗链做处理2:针对不同的文件类型view plainprint?location~.*\.(wma|wmv|asf|mp3|mmf|zip|rar|jpg|gif|png|swf|flv)${if($ht 阅读全文
posted @ 2013-10-09 15:46 toxic 阅读(3437) 评论(0) 推荐(0) 编辑