“Nginx”的版本间的差异

来自wrc's Wiki
跳到导航 跳到搜索
(建立内容为“{{TODO|Add page}}”的新页面)
 
第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]]

2021年4月25日 (日) 04:51的版本

TODO

Add page


配置

封禁 IP

[1]

/etc/nginx/blockips.conf:

deny 1.2.3.4;
deny 5.6.7.8;
# deny 192.168.1.0/24;
# deny all;

/etc/nginx/nginx.confhttp 块中加入

include blockips.conf;

参考资料