Linux HTTP代理Squid 基本变更配置及目标白名单方式限制转发

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
相关推荐
柳鲲鹏17 分钟前
RGB转换为NV12,查表式算法
linux·c语言·算法
程序猿(雷霆之王)21 分钟前
Linux——线程安全
linux·运维·服务器
飞雁科技37 分钟前
CRM客户管理系统定制开发:如何精准满足企业需求并提升效率?
大数据·运维·人工智能·devops·驻场开发
wanhengidc37 分钟前
云手机畅玩 梦幻西游
运维·服务器·arm开发·智能手机·自动化
wdfk_prog1 小时前
[Linux]学习笔记系列 -- [kernel][time]timer
linux·笔记·学习
fy zs1 小时前
linux下动静态库
linux
佐杰1 小时前
Jenkins安装部署
运维·servlet·jenkins
深耕AI1 小时前
如何在云服务器上找回并配置宝塔面板:完整指南
运维·服务器
zly35001 小时前
360极速浏览器 安装猫抓插件的方法
运维
Jerry2505091 小时前
怎么才能实现网站HTTPS访问?
网络协议·http·网络安全·https·ssl