nginx限制ip并发数
十二月 1st, 2009 Posted in Nginx | 阅读次数: 649 次
Author:gaojinbo
Time:2009-12-01
nginx限制ip并发数,也是说限制同一个ip同时连接服务器的数量
1.添加limit_zone
这个变量只能在http使用
vi /usr/local/nginx/conf/nginx.conf
limit_zone one $remote_addr 10m;
2.添加limit_conn
这个变量可以在http, server, location使用
我只限制一个站点,所以添加到server里面
vi /usr/local/nginx/conf/host/gaojinbo.com.conf
limit_conn one 10;
3.重启nginx
killall -HUP nginx
完成!
相关日志:
Tags: Nginx
五月 2nd, 2011 at 04:21
Favourite Sites…
[...]below you’ll find my recommended links page http://www.pregnancymiraclez.net/my-favourite-sites/ with some very good websites that I think you should definitely go visit[...]…
六月 17th, 2011 at 06:31
Related Websites…
[...]some other related resources on the web that are worth viewing on this subject include[...]…
八月 22nd, 2011 at 02:33
Visitor recommendations trackback……
[...]one of our visitors recently recommended the following website[...]………