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
相关推荐
科士威传动15 小时前
微型导轨的类型性能差异与场景适配需求
大数据·运维·人工智能·科技·机器人·自动化
Yengi16 小时前
【test】gtkmm-环境搭建
linux
乾元16 小时前
OSPF / BGP 自动化设计与错误避坑清单—— 控制平面是“算出来的”,不是“敲出来的”
运维·网络·人工智能·平面·华为·自动化
Lightning-py16 小时前
SSH远程连接服务器耗时>10s
linux·服务器·网络
starvapour16 小时前
基于端口转发部署seafile私人云盘服务器
linux·ubuntu·seafile
DeepFlow 零侵扰全栈可观测16 小时前
可观测性与人工智能(AI)的共生关系:定义、互需性及在IT系统自动化中的实践
运维·人工智能·自动化
丿BAIKAL巛16 小时前
如何解决CentOS启动时XFS 文件系统的元数据损坏问题
linux·运维·centos
胖好白16 小时前
Linux内核设计与实现读书笔记—(二)从内核出发
linux
飞Link16 小时前
Linux下的Docker安装教程
linux·运维·服务器·docker·容器
Better Bench16 小时前
ubuntu 不同系统架构(aarch64\arm64\x86_64)安装miniconda以及配置pip镜像
linux·ubuntu·pip