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
相关推荐
YouEmbedded5 小时前
解码UDP
linux·udp
w***48826 小时前
Linux安装redis
linux·运维·redis
wanhengidc7 小时前
深度了解云手机是什么
运维·服务器·科技·智能手机·云计算
python百炼成钢8 小时前
28.嵌入式 Linux LED 驱动开发实验
linux·运维·驱动开发
阿珊和她的猫9 小时前
HTTP 状态码 304:未修改(Not Modified)的深度解析
网络协议·http·状态模式
西风未眠10 小时前
高效编辑之vi/vim常用快捷键汇总
linux·编辑器·vim
_Stellar10 小时前
Linux 服务器管理 根目录文件夹权限设置 基于用户组实现安全共享
linux·服务器·安全
LUCIFER10 小时前
驱动开发:详细分析 DTB、DTS、DTSI、DTBO 的区别、用途及它们之间的关系
linux·服务器·驱动开发
BullSmall11 小时前
Test Matrix:测试矩阵(IT 领域定义 + 设计实践 + 华为场景应用)
运维·服务器
liuyao_xianhui12 小时前
版本控制器git--gdb/cgdb
linux·运维·服务器·git