Squid代理白名单设置
服务器上有一个squid的代理工具,之前配置了仅限127.0.0.1可以用,现在要开放给远端ip来使用,这就需要做一些调整,在Squid中开启ACL策略。
# =================================== MODE ====
# http proxy 监听端口, Server 的 Connect To 选项指向此端口
#http_port 127.0.0.1:3128
# =================================== ACCESS CONTROL ====
# 接受所有 http 请求(来自 127.0.0.1)
http_port 63128
# =================================== ACCESS CONTROL ====
# 接受所有 http 请求(来自 127.0.0.1)
#http_access allow all
#远端允许访问Squid的IP地址,多个IP用空格间隔
acl myacl src 127.0.0.1 8.8.8.8 8.8.4.4
http_access allow myacl
http_access deny all
# =================================== CONNECTION ====
connect_timeout 30 seconds # 连接超时
visible_hostname squid_FP_1 # 当前节点本机名称
client_persistent_connections on # 启用 client <-> squid 之间的长连接支持
client_idle_pconn_timeout 180 minutes #client <-> squid 之间的长连接空闲超时
half_closed_clients on # 允许 TCP 四次挥手过程中的半双工状态
server_persistent_connections on # 启用 squid <-> server 之间的长连接支持
server_idle_pconn_timeout 180 minute # squid <-> server 之间的长连接空闲超时
forwarded_for transparent # 不添加、不修改也不删除 X-Forwarded-For 头(默认添加)
cache deny all # squid 3.x 不能正确缓存 gzip+chuncked 内容
# =================================== LOG FILE ====
access_log none
#access_log daemon:/var/log/squid/access.log squid
cache_store_log none
本作品采用 知识共享署名-相同方式共享 4.0 国际许可协议 进行许可。
评论已关闭