更改

跳到导航 跳到搜索
添加492字节 、 2021年4月25日 (日) 04:51
无编辑摘要
第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]]

导航菜单