Nginx½ûÖ¹¶ñÒâUser Agent²É¼¯ÍøÕ¾
½ûÓÃһЩUser Agent¿ÉÒÔ½ÚʡһЩÁ÷Á¿Ò²¿ÉÒÔ·ÀֹһЩ¶ñÒâµÄ·ÃÎÊ£¬ÓÈÆäÊDz¿·ÝËÑË÷ÒýÇæÅÀ³æ£¬ÀýÈçÎÒÃǵÄÍøÕ¾¾ÍÊÇÒ»¸öµØ·½ÐÔÕ¾µã£¬Ã»ÓбØÒª±»Ò»Ð©¹úÍâµÄËÑË÷ÒýÇæÅÀ³æË÷Òý£¬¶¼¿ÉÒÔ½ûµô£¬¾ßÌå²Ù×÷ÈçÏ£º
1¡¢±à¼¸ÃÎļþagent_deny.con£º
# vi /usr/local/nginx/conf/agent_deny.conf
2¡¢Ôö¼ÓÒÔÏÂÄÚÈÝ(ʾÀý)£º
if ($http_user_agent ~* (Scrapy|Curl|HttpClient)) { return 404; } #¿Õagent if ($http_user_agent ~ ^$) { return 404; } #ÇëÇó·½Ê½ÏÞÖÆ if ($request_method !~ ^(GET|HEAD|POST)$) { return 403; }
3¡¢±à¼Îļþnginx.conf:
ÔÚserverÖÐÒýÈëagent_deny.conf
include agent_deny.conf;
ÓÐһЩµ¥´ÊÖмäÓпոñ£¬ËùÒÔÁ½±ßÐèҪʹÓÃË«ÒýºÅ£¬½ûÓÃÁËÈô¸É¸öËÑË÷ÒýÇæÅÀ³æ£¬»¹Óм¸¸ö¶ñÒâ¹àË®»úµÈ£¬¿ÉÒÔ·ÖÎöÈÕÖ¾¸ù¾ÝÇé¿öÆÁ±Î¶ñÒâµÄUser Agent¡£
ÍƼöÐÅÏ¢
- linuxÃüÁîѧϰ±Ê¼Ç£¨11£©£ºnlÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨5£©£ºrmÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨4£©£ºmkdirÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨1£©£ºlsÃüÁî
- ½«CentosµÄyumÔ´¸ü»»Îª¹úÄڵİ¢ÀïÔÆÔ´
- ʹÓÃNginxÌí¼Óheader·ÀÖ¹ÍøÒ³±»frame
- linuxϼÓËÙscp´«Êä´óÎļþµÄËÙ¶È
- linuxϵͳÉ϶ÔnginxÈÕÖ¾·Ö¸î´¦Àí
- lnmp/nginxϵͳÕæÕýÓÐЧµÄͼƬ·ÀµÁÁ´ÍêÕûÉèÖÃÏê½â
- Í»ÆÆÊ®Íò²¢·¢µÄNginxµÄÅäÖü°ÓÅ»¯
ÈÈÃÅÐÅÏ¢
- nohup: redirecting stderr to stdou....
- ʹÓÃlog_formatΪNginx·þÎñÆ÷ÉèÖøüÏêϸµÄÈÕÖ¾¸ñʽ
- jquery easyUI--dataGrid-Json
- [Ô´´]·ÂGoogle Reader¡¢ÐÂÀË΢²©¡¢ÌÚѶ΢²©µ....
- ÀûÓÃKeepalived+mysql¹¹½¨¸ß¿ÉÓÃMySQLË«Ö÷×Ô¶....
- Nginx+keepalivedʵÏÖ¸ºÔؾùºâºÍË«»úÈȱ¸¸ß¿ÉÓÃ
- jqueryʵÏÖÒ³Ãæ¼ÓÔؽø¶ÈÌõ
- Rolling cURL: PHP²¢·¢×î¼Ñʵ¼ù
- codeigniter ·ÓÉÖÕ¼«ÓÅ»¯(url rewrite)
- linuxÏÂÉèÖÃsshÎÞÃÜÂëµÇ¼
×î½ü¸üÐÂ
- ²éÕÒ²¢É¾³ý.svnĿ¼Îļþ
- redis ÆßÖÖÊý¾ÝÀàÐ͵ÄʹÓó¡¾°
- linux ÏÂÎļþ¸´ÖƵ½windowsÏÂÂÒÂëµÄ½â¾ö°ì·¨
- nginx³öÏÖ502 upstream sent too big he....
- linuxÏÂsudoÅäÖÃÏê½â
- linuxÃüÁîѧϰ±Ê¼Ç£¨15£©£ºtailÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨14£©£ºheadÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨13£©£ºlessÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨12£©£ºmoreÃüÁî
- ¼ÓÃÜËã·¨±È½Ï3DES AES RSA ECC MD5 SHA1µÈ
ÆÀÂÛ