83f

设置allow、deny参数,也可作用于TCP和UDP代理:

allow 114.114.114.114; 
deny all;

配置/etc/sysconfig/iptables

-A INPUT -s 114.114.114.114 -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT

配置/etc/nginx/nginx.conf

if ($remote_addr !~ ^(114.114.114.114 |114.114.114.115)) { rewrite ^.*$ /403.jsp last; }

设置$http_x_forwarded_for参数

if ($http_x_forwarded_for !~ ^(114.114.114.114 |114.114.114.115)) { rewrite ^.*$ /maintence.php last; }

发表回复

您的电子邮箱地址不会被公开。

Captcha Code