Linux HTTP代理Squid 基本配置及目标白名单方式限制转发
Linux HTTP代理Squid 基本变更配置及目标白名单方式限制转发 https://www.cnblogs.com/iAmSoScArEd/p/18546341
大部分保持默认即可
1、文件管理转发白名单
sudo touch /etc/squid/whitelistip
sudo touch /etc/squid/whitelistdomain
# 目的地ip地址
acl whitelistip dst "/etc/squid/whitelistip"
http_access allow whitelistip
# 目的地域名限制,可使用.xxx.com 放开整个子域名
acl whitelistdomain dstdomain "/etc/squid/whitelistdomain"
http_access allow whitelistdomain
2、限制来源ip
sudo touch /etc/squid/whitelistsrcip
# 可以使用ip段如:12.12.12.1/24
acl whitelistsrcip src "/etc/squid/whitelistsrcip"
http_access allow whitelistsrcip
3、日志存储
# 详细:https://wiki.squid-cache.org/SquidFaq/SquidLogs#accesslog
logformat combined %>a %ui %un [%tl] "%rm %ru HTTP/%rv" %Hs %<st "%{Referer}>h" "%{User-Agent}>h" %Ss:%Sh %{host}>h
# 日志路径
access_log /data/logs/squid/access.log combined
4、监听端口
# 自己定
http_port 8999
5、端口白名单
默认配置放开了很多ip,可以根据情况只放开80,443等自己要用的,把其他的注释了
acl SSL_ports port 443
acl Safe_ports port 443
acl Safe_ports port 80
俗人昭昭,我独昏昏。俗人察察,我独闷闷。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)