[英]How to configure Squid to return custom error pages based on result of eCAP adapters?
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/
。 目前,我不在錯誤頁面上查找病毒詳細信息,它可以是任何靜態頁面。
提前致謝!
我發現解決方案為:
在/usr/local/squid/share/errors/templates/ERR_ANY_NAME
創建一個頁面。 然后在squid.conf
的末尾添加以下行:
deny_info ERR_ANY_NAME clamav_service_req
clamav_service_req
與ecap_service
指令中給出的相同,並且ERR_ANY_NAME
是要顯示的自定義頁面。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.