第1行: |
第1行: |
| {{TODO|Add page}} | | {{TODO|Add page}} |
| + | |
| + | == 配置 == |
| + | |
| + | === 封禁 IP === |
| + | |
| + | <ref>[https://nginx.org/en/docs/http/ngx_http_access_module.html Module ngx_http_access_module]</ref> |
| + | |
| + | <code>/etc/nginx/blockips.conf</code>: |
| + | |
| + | <syntaxhighlight lang=nginx> |
| + | deny 1.2.3.4; |
| + | deny 5.6.7.8; |
| + | # deny 192.168.1.0/24; |
| + | # deny all; |
| + | </syntaxhighlight> |
| + | |
| + | 在 <code>/etc/nginx/nginx.conf</code> 中 <code>http</code> 块中加入 |
| + | |
| + | <syntaxhighlight lang=nginx> |
| + | include blockips.conf; |
| + | </syntaxhighlight> |
| + | |
| + | == 参考资料 == |
| + | |
| + | <references /> |
| + | |
| + | [[Category:Server]] |