Nginx 的ngx_http_access_module 模块可以封配置内的ip或者ip段

    1. deny IP;
    2. deny subnet;
    3. allow IP;
    4. deny all;
    5. allow all;

    [root@localhost ~]# vim /usr/local/nginx/conf/nginx.conf

    1. http {
    2. deny 192.168.10.1;
    3. include mime.types;
    4. default_type application/octet-stream;
    5. ......
    6. }

    [root@localhost ~]# /usr/local/nginx/sbin/nginx -t
    [root@localhost ~]# /usr/local/nginx/sbin/nginx -s reload

    已无法正常访问 http://192.168.10.100/
    image.png