您的位置:首页 > 财经 > 金融 > 太原网站开发定制_互联网保险经纪公司十大排名_百度小说排行_网站推广方法

太原网站开发定制_互联网保险经纪公司十大排名_百度小说排行_网站推广方法

2025/4/2 13:16:21 来源:https://blog.csdn.net/gsls200808/article/details/146452590  浏览:    关键词:太原网站开发定制_互联网保险经纪公司十大排名_百度小说排行_网站推广方法
太原网站开发定制_互联网保险经纪公司十大排名_百度小说排行_网站推广方法

从nginx访问日志404中提取,提取后统一改成C段地址封禁

使用map方式

nginx.conf增加配置 在http模块增加 map配置

http {include       /etc/nginx/mime.types;default_type  application/octet-stream;log_format  main  '$remote_addr $host $remote_user [$time_local] "$request" ''$status $body_bytes_sent "$http_referer" ''"$http_user_agent" "$http_x_forwarded_for"';access_log  /var/log/nginx/access.log  main;sendfile        on;#tcp_nopush     on;keepalive_timeout  65;#gzip  on;map $remote_addr $block_ip {default 0;          # 默认不封禁#192.168.1.1 1;   # 封禁单个 IP#192.168.1.0/24 1;  # 封禁 IP 段1.192.32.0/24 1;101.228.67.0/24 1;101.68.246.0/24 1;103.148.73.0/24 1;103.251.98.0/24 1;106.120.143.0/24 1;106.16.213.0/24 1;106.38.79.0/24 1;106.75.157.0/24 1;110.249.201.0/24 1;110.249.202.0/24 1;110.53.52.0/24 1;111.166.156.0/24 1;111.18.44.0/24 1;111.192.167.0/24 1;111.201.5.0/24 1;111.204.101.0/24 1;111.205.21.0/24 1;111.225.148.0/24 1;111.225.149.0/24 1;111.30.253.0/24 1;111.55.13.0/24 1;112.1.122.0/24 1;112.102.43.0/24 1;112.112.144.0/24 1;112.117.205.0/24 1;112.39.121.0/24 1;112.40.148.0/24 1;112.50.77.0/24 1;112.64.161.0/24 1;112.65.86.0/24 1;113.110.145.0/24 1;113.111.7.0/24 1;113.111.82.0/24 1;113.118.242.0/24 1;113.194.224.0/24 1;113.200.174.0/24 1;113.200.78.0/24 1;113.201.132.0/24 1;113.215.188.0/24 1;113.215.189.0/24 1;113.54.153.0/24 1;113.89.235.0/24 1;114.119.128.0/24 1;114.221.23.0/24 1;114.246.95.0/24 1;114.86.7.0/24 1;114.88.24.0/24 1;115.171.61.0/24 1;115.236.91.0/24 1;115.57.143.0/24 1;116.228.116.0/24 1;116.231.59.0/24 1;116.232.141.0/24 1;116.234.66.0/24 1;117.129.26.0/24 1;117.129.64.0/24 1;117.136.108.0/24 1;117.146.50.0/24 1;117.44.48.0/24 1;117.48.146.0/24 1;117.80.154.0/24 1;117.88.200.0/24 1;117.89.216.0/24 1;117.90.233.0/24 1;118.114.232.0/24 1;119.131.139.0/24 1;119.133.7.0/24 1;119.164.71.0/24 1;119.180.25.0/24 1;119.36.242.0/24 1;119.78.253.0/24 1;120.192.30.0/24 1;120.194.158.0/24 1;120.224.42.0/24 1;120.229.82.0/24 1;120.230.136.0/24 1;120.231.210.0/24 1;120.235.21.0/24 1;120.245.115.0/24 1;120.245.128.0/24 1;121.15.186.0/24 1;121.228.148.0/24 1;121.237.36.0/24 1;122.226.80.0/24 1;123.113.57.0/24 1;123.121.211.0/24 1;123.145.99.0/24 1;123.146.7.0/24 1;123.156.238.0/24 1;123.174.71.0/24 1;123.6.49.0/24 1;124.64.122.0/24 1;124.90.53.0/24 1;125.32.27.0/24 1;134.17.14.0/24 1;138.246.253.0/24 1;14.110.126.0/24 1;14.117.206.0/24 1;14.123.234.0/24 1;14.155.233.0/24 1;14.19.135.0/24 1;14.212.105.0/24 1;14.212.131.0/24 1;14.26.172.0/24 1;157.55.39.0/24 1;167.71.223.0/24 1;170.39.218.0/24 1;171.103.86.0/24 1;171.11.145.0/24 1;171.208.150.0/24 1;171.213.251.0/24 1;171.41.148.0/24 1;171.88.66.0/24 1;172.203.190.0/24 1;175.10.207.0/24 1;175.10.25.0/24 1;175.2.61.0/24 1;175.8.92.0/24 1;18.217.126.0/24 1;180.102.34.0/24 1;182.39.142.0/24 1;183.134.59.0/24 1;183.157.122.0/24 1;183.17.235.0/24 1;183.173.197.0/24 1;183.211.64.0/24 1;185.170.167.0/24 1;185.180.141.0/24 1;185.191.171.0/24 1;194.238.25.0/24 1;194.26.192.0/24 1;195.191.219.0/24 1;195.20.18.0/24 1;195.49.212.0/24 1;195.88.82.0/24 1;196.251.67.0/24 1;198.46.142.0/24 1;202.195.159.0/24 1;202.197.66.0/24 1;202.98.17.0/24 1;210.32.43.0/24 1;211.137.105.0/24 1;211.144.19.0/24 1;211.166.250.0/24 1;211.90.249.0/24 1;216.244.66.0/24 1;217.182.175.0/24 1;218.20.11.0/24 1;218.4.185.0/24 1;218.75.230.0/24 1;218.75.78.0/24 1;218.76.62.0/24 1;218.93.27.0/24 1;219.136.147.0/24 1;219.77.118.0/24 1;220.181.51.0/24 1;220.200.58.0/24 1;221.180.206.0/24 1;221.206.216.0/24 1;221.216.116.0/24 1;221.4.34.0/24 1;222.126.182.0/24 1;222.168.41.0/24 1;222.190.117.0/24 1;222.201.136.0/24 1;222.201.176.0/24 1;223.102.178.0/24 1;223.104.81.0/24 1;223.106.27.0/24 1;223.160.129.0/24 1;223.160.172.0/24 1;223.160.206.0/24 1;223.220.190.0/24 1;223.64.97.0/24 1;223.72.172.0/24 1;223.73.222.0/24 1;223.85.240.0/24 1;23.229.113.0/24 1;27.197.36.0/24 1;27.205.144.0/24 1;35.187.232.0/24 1;36.129.52.0/24 1;36.141.83.0/24 1;36.150.60.0/24 1;36.56.213.0/24 1;39.171.197.0/24 1;39.79.139.0/24 1;4.227.36.0/24 1;47.128.115.0/24 1;47.128.23.0/24 1;47.128.31.0/24 1;47.128.32.0/24 1;47.128.34.0/24 1;45.148.10.0/24 1;58.20.19.0/24 1;58.212.166.0/24 1;58.242.237.0/24 1;58.251.94.0/24 1;58.35.105.0/24 1;58.56.101.0/24 1;58.62.33.0/24 1;59.175.60.0/24 1;59.67.0.0/24 1;60.2.65.0/24 1;60.216.19.0/24 1;60.27.137.0/24 1;61.144.102.0/24 1;61.177.71.0/24 1;61.185.198.0/24 1;61.242.213.0/24 1;78.153.140.0/24 1;}include /etc/nginx/conf.d/*.conf;
}

在default的server里使用map配置的封禁ip

server {listen       80;listen  [::]:80;listen  443 ssl;server_name  blog.example.com;ssl_certificate   /etc/letsencrypt/cert/blog.example.com/fullchain.pem;ssl_certificate_key  /etc/letsencrypt/cert/blog.example.com/privkey.pem;location ~/.well-known/acme-challenge/ {root /usr/share/nginx/html;}location = /xmlrpc.php {return 403;}location / {if ($block_ip) {return 403;  # 返回 403 Forbidden}#limit_req zone=mylimit burst=4 nodelay;#limit_req_status 598;proxy_pass http://wordpress/;proxy_set_header Host $host;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Forwarded-Proto $scheme;}
}

封禁之后,清净很多。

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com