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
相关推荐
qq_3482318512 小时前
Spring Boot 项目各模块整合
运维·jenkins
郝学胜-神的一滴12 小时前
Linux信号集操作函数详解
linux·服务器·开发语言·c++·程序人生
eggrall12 小时前
Linux 基础开发工具 —— 解锁高效开发的底层密钥
linux·运维·服务器
weixin_3077791312 小时前
基于AWS安全组的两层架构访问控制设计与实现
运维·云原生·架构·云计算·aws
全栈工程师修炼指南12 小时前
Nginx | 负载均衡策略:ip_hash / hash 会话保持实践
运维·tcp/ip·nginx·负载均衡·哈希算法
哇哈哈&12 小时前
rabbitmq最简单的安装方法
linux·运维·centos
虎头金猫12 小时前
从杂乱到有序,Paperless-ngx 加个cpolar更好用
linux·运维·人工智能·docker·开源·beautifulsoup·pandas
源之缘-OFD先行者13 小时前
定制化 Live555 实战:按需开发低耗 RTSP 服务器,完美适配 C# 项目
运维·服务器·c#
赖small强13 小时前
【Linux 内存管理】Linux 低内存平台文件缓存导致的虚假内存不足问题分析与解决方案
linux·缓存·oom·水位线
慾玄13 小时前
ce复习--Chrony服务器
linux