linux - 在lnmp环境中,我想把网站屏蔽某些国家的ip地址访问,请问用什么方法?
PHP中文网
PHP中文网 2017-04-17 16:05:33
0
4
418
  • 我不想让俄罗斯和美国的用户访问我的网站,这些国家的ip地址哪里有最新的ip地址集合

  • 具体的命令是什么?操作逻辑和详细的操作步骤,如果有详细的图文教程就更好了,先谢谢大家

PHP中文网
PHP中文网

认证高级PHP讲师

reply all(4)
左手右手慢动作

http://www.vpsee.com/2011/03/...

Now that nginx installed through the distribution version may have integrated the geoip module, the first step is not needed. The distribution may also have packaged the GeoIP database, so you don't need to create it yourself. You still have to read the instructions in the release version for details.

左手右手慢动作

Two ideas:

  1. Based on iptables, but first you need to know the IP range

  2. Program level control, get the access IP and then query the IP library.
    The specific method is quite simple, you can look up the information by yourself.

伊谢尔伦

If you find it troublesome to block IPs, why not think differently.
Using Amou Cloud’s intelligent cloud resolution, domain name resolution is not provided for certain countries or regions.

迷茫

The first step is to introduce a judgment function module. This function module compares with the latest IP library. Once the Russian and American IPs are found, it will jump to other websites or display a fake 404 page. Perform normal entry when it is not the above IP.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!