我们可以在 Docker 容器中安装 mod_qos 包。
然后我们可以在/..../modules/目录中验证mod_qos的模块是否安装。
如果安装正确,我们可以在/..../conf.d/mod_qos.conf文件中添加mod_qos.conf文件,配置如下
## QoS Settings
<IfModule mod_qos.c>
# handles connections from up to 100000 different IPs
#QS_ClientEntries 100000
# will allow only 10 connections per IP
QS_SrvMaxConnPerIP 30
# maximum number of active TCP connections is limited to 256
MaxClients 256
# disables keep-alive when 70% of the TCP connections are occupied:
QS_SrvMaxConnClose 180
# minimum request/response speed (deny slow clients blocking the server i.e. slowloris keeping connections open without requesting anything
QS_SrvMinDataRate 150 1200
# and limit request header and body (carefull,that limits uploads and post requests too):
LimitRequestFields 30
QS_LimitRequestBody 102400
</IfModule>