Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Squid 用法

说明

  • 本页记录 Squid 的基础转发规则, 白名单 / 黑名单配置和上游代理设置方式.
  • 适合作为基于 ACL 规则的代理分流配置速查页.

squid 用法

# basic 设置:

# 默认端口
# http_port 3128

# 添加3个规则, 这些规则:

# 白名单
acl cn    dstdom_regex 'cn.url_regex.lst'
# 黑名单
acl gfwed dstdom_regex 'gfw.url_regex.lst'
# 定制黑名单
acl custom dstdom_regex 'custom.url_regex.lst'

# 应用这些规则:

# 必须转发
never_direct  allow gfwed
# 必须转发
never_direct  allow custom
# 直连
never_direct  deny  cn

# 请求转发
cache_peer 127.0.0.1 parent 1080 0 no-query name=ssr