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
相关推荐
❀͜͡傀儡师31 分钟前
docker部署mariadb 12.1.2版本,支持arm架构
运维·docker·容器·mariadb
青青草原技术员灰太狼7 小时前
Nginx的https搭建
linux·服务器·网络
xu_yule7 小时前
网络和Linux网络-4(应用层)序列化和反序列化(网络计算器)
linux·网络
宇钶宇夕7 小时前
三旺 INP314T 网关快速入门指南:从登录到基础配置
运维·自动化·软件工程
2***s6728 小时前
Failed to restart nginx.service Unit nginx.service not found
运维·nginx
寂寞旅行8 小时前
解决摄像头/麦克风 在HTTP环境下的调用问题
网络·网络协议·http
爱学习的程序媛8 小时前
《图解HTTP》核心知识点梳理
网络·网络协议·http·https
YongCheng_Liang9 小时前
Zabbix 6.4 完整部署教程:从环境准备到监控实战
linux·运维·zabbix
小白电脑技术9 小时前
旧电脑安装流畅的系统?用虚拟机先体验一下Linux Mint!
linux·电脑
数字化顾问9 小时前
(65页PPT)大型集团物料主数据管理系统建设规划方案(附下载方式)
大数据·运维·人工智能