如何解决病毒网关不能上传问题?
- By : Will
- Category : Reverse Proxy
Reverse Proxy
1 前言
一个问题,一篇文章,一出故事。
笔者生产环境的病毒网关遇到上传文件过大报500错误,关于病毒网关的部署,请参阅如下文章,
病毒网关使用如下命令查看Nginx日志,
tail -f /var/log/nginx/access.log
可见如下日志,
121.13.108.65 - - [24/Nov/2021:10:55:49 +0800] "POST /upload HTTP/1.1" 500 22 "-" "okhttp/3.14.9" "-"
病毒网关使用如下命令查看Clammit日志,
tail -f /var/log/clammit/clammit.log
可见如下日志,
2021/11/24 10:55:49 Unable to scan file (VID_20211122_141355.mp4): write tcp 127.0.0.1:59218->127.0.0.1:3310: write: broken pipe 2021/11/24 10:55:49 Interceptor has deemed that this request should not be forwarded
病毒网关使用如下命令查看Clamav日志,
tail -f /var/log/clamav/clamd.log
可见如下日志,
Wed Nov 24 10:55:49 2021 -> WARNING: INSTREAM: Size limit reached, (requested: 1024, max: 395)
注:从以上人日志分析,为上传的文件超过Clamav的扫描默认限制,于是逐级返回错误。
2 最佳实践
2.1 修改Clamav配置
vim /etc/clamd.conf
修改如下配置,
StreamMaxLength 0 MaxScanSize 0 MaxFileSize 0
2.2 重启服务使配置生效
/etc/init.d/clamd restart /etc/init.d/clamd status
参阅文档
==============
https://github.com/artefactual/archivematica/issues/753
没有评论