0

eCAP 适配器配置squid.conf为:

acl bypass_scan_types_req req_mime_type -i ^text/     
acl bypass_scan_types_req req_mime_type -i ^application/x-javascript 
acl bypass_scan_types_req req_mime_type -i ^application/x-shockwave-flash  
acl bypass_scan_types_req req_mime_type -i ^image/ 
acl bypass_scan_types_req req_mime_type -i ^video     
acl bypass_scan_types_req req_mime_type -i ^audio 

acl bypass_scan_types_req req_mime_type -i ^.*application\/x-mms-framed.*$
acl bypass_scan_types_rep rep_mime_type -i ^text/ 
acl bypass_scan_types_rep rep_mime_type -i ^application/x-javascript 
acl bypass_scan_types_rep rep_mime_type -i ^application/x-shockwave-flash 
acl bypass_scan_types_rep rep_mime_type -i ^image/ 
acl bypass_scan_types_rep rep_mime_type -i ^video 
acl bypass_scan_types_rep rep_mime_type -i ^audio 
acl bypass_scan_types_rep rep_mime_type -i ^.*application\/x-mms-framed.*$

loadable_modules /usr/local/lib/ecap_clamav_adapter.so 

ecap_service clamav_service_req reqmod_precache uri=ecap://e-cap.org/ecap/services/clamav?mode=REQMOD bypass=off 
ecap_service clamav_service_resp respmod_precache uri=ecap://e-cap.org/ecap/services/clamav?mode=RESPMOD bypass=on 

adaptation_access clamav_service_req allow !bypass_scan_types_req all 
adaptation_access clamav_service_resp allow !bypass_scan_types_rep all

如果检测到病毒,适配器会返回一些病毒详细信息,并且 Squid 会生成默认错误页面。我想显示自定义错误页面而不是默认页面。

我尝试添加deny_info,但我不知道acl在这种情况下如何指定。我试过的deny_info是:

deny_info custom_error.html <my_acl_here>

custom_error.html存在于哪里~/ecap/squid-XXXX/errors/en/。目前,我不是在错误页面上查找病毒详细信息,它可能是任何静态页面。

提前致谢!

4

1 回答 1

0

我找到了解决方案:

在 处创建一个页面/usr/local/squid/share/errors/templates/ERR_ANY_NAME。然后在末尾添加以下行squid.conf

deny_info ERR_ANY_NAME clamav_service_req

与指令中给出的clamav_service_req相同,是要显示的自定义页面。ecap_serviceERR_ANY_NAME

于 2017-11-10T10:18:19.070 回答