fixed the way how are created the iptables rules in 'nginx' graph

This commit is contained in:
Jordi Sanfeliu 2013-01-25 11:39:43 +01:00
parent 0ea82d636f
commit 08e9c9768a
1 changed files with 3 additions and 3 deletions

View File

@ -83,9 +83,9 @@ sub nginx_init {
}
if($config->{os} eq "Linux") {
system("iptables -N nginx_IN 2>/dev/null");
system("iptables -I INPUT -p tcp --sport 1024:65535 --dport $nginx->{port} -m state --state NEW,ESTABLISHED,RELATED -j nginx_IN -c 0 0");
system("iptables -I OUTPUT -p tcp --sport $nginx->{port} --dport 1024:65535 -m state --state ESTABLISHED,RELATED -j nginx_IN -c 0 0");
system("iptables -N monitorix_nginx_IN 2>/dev/null");
system("iptables -I INPUT -p tcp --sport 1024:65535 --dport $nginx->{port} -m state --state NEW,ESTABLISHED,RELATED -j monitorix_nginx_IN -c 0 0");
system("iptables -I OUTPUT -p tcp --sport $nginx->{port} --dport 1024:65535 -m state --state ESTABLISHED,RELATED -j monitorix_nginx_IN -c 0 0");
}
if(grep {$_ eq $config->{os}} ("FreeBSD", "OpenBSD", "NetBSD")) {
system("ipfw delete $nginx->{rule} 2>/dev/null");