¸ÕÓöµ½Ò»¸öBugÔÚÍøÂçºÜ¿¨µÄÇé¿öϲÅÄÜÖØÏÖ£¬±¾µØµ÷ÊÔ·ÃÎʱ¾»úËÙ¶ÈÌ«¿ì£¬ÅäÖÃNginx³É¹¦´ïµ½ÏÞËÙÄ¿µÄ£¬ÔÚ´Ë·ÖÏí³öÀ´¡£
ÅäÖüòµ¥£¬Ö»Ðè3ÐУ¬´ò¿ª"nginx¸ùĿ¼/conf/nginx.conf"ÅäÖÃÎļþÐÞ¸ÄÈçÏ£º
http{ ¡¡ limit_zone one $binary_remote_addr 10m; ¡¡ server { location / { ¡¡ limit_conn one 2; limit_rate 40k; } } }
ÒÔÉÏÅäÖýâÊÍ£ºlimit_zoneÕë¶Ôÿ¸öIP¶¨ÒåÒ»¸ö´æ´¢session״̬µÄÈÝÆ÷¡£Õâ¸öʾÀýÖж¨ÒåÁËÒ»¸öÃû½ÐoneµÄ10m´óСµÄÈÝÆ÷£¬Õâ¸öÃû×Ö»áÔÚºóÃæµÄlimit_connÖÐʹÓá£limit_connÖ¸¶¨Ã¿¸ö·Ã¿ÍÖ»Äܽ¨Á¢Á½ÌõÁ´½Ó£¬limit_rateÏÞÖÆÿÌõÁ´½ÓµÄËٶȲ»³¬¹ý40K¡£ËùÒÔ£¬ÒÔÉÏÅäÖÃÏÞÖÆÓû§·ÃÎÊ´ËÕ¾µã×ÜËÙ¶ÈÉÏÏÞΪ80K¡£
ÊôÐÔ˵Ã÷limit_zone
Óï·¨£ºlimit_zone zone_name $variable memory_max_size
×÷ÓÃÓò£ºhttp
limit_conn
Óï·¨£º limit_conn zone_name ÔÊÐíÿ¸ö¿Í»§¶Ë½¨Á¢µÄÁ´½ÓÊý
×÷ÓÃÓò£ºhttp, server, location
limit_rate
Óï·¨£ºlimit_rate ÿ¸öÁ´½ÓµÄ×î´óËÙÂÊ
×÷ÓÃÓò£ºhttp, server, location
°¸Àý°¸Àý1£ºÏÂÔØ×ÊÔ´·ÅÔÚhttp://domain/download/·¾¶Ï£¬Õë¶Ôÿ¸ö·Ã¿ÍÏÂÔØÏÞËÙΪ100K£¬ÇÒÖ»ÄÜͬʱÁ´½Ó1¸öÏÂÔØÁ´½Ó¡£
http{ server { location /download/ { ¡¡ limit_conn one 1; limit_rate 100k; } } .... }°¸Àý2£ºÃ¿¸ö·Ã¿Í·ÃÎÊÕ¾µãµÄËÙ¶È×î´ó²»³¬¹ý100K£¬Çҿɽ¨Á¢5ÌõÁ´½Ó¡£
http{ server { location /download/ { ¡¡ limit_conn one 5; limit_rate 20k; } } ...... }ÓÉÓÚlimit_rateÊǶÔÿ¸öÁ´½ÓÏÞËÙ£¬ÒÔÉÏÀý×ÓÓÐ5ÌõÁ´½Ó£¬±£Ö¤×ÜËٶȲ»³¬¹ý100KÔòÿÌõÁ´½Ó²»³¬¹ý20K
ÍƼöÐÅÏ¢
- 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µÈ
ÆÀÂÛ