当前位置: 首页 > article >正文

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

http://www.kler.cn/a/419492.html

相关文章:

  • Flutter 之 InheritedWidget
  • 【大模型】ChatGPT 提示词优化进阶操作实战详解
  • 新能源,半导体,医药生物等高科技企业如何高效、安全、智能管理文件数据
  • 汽车IVI中控开发入门及进阶(三十五):架构QML App Architecture Best Practices
  • Docker Buildx 与 CNB 多平台构建实践
  • 无人机地面遥控遥测技术与算法概述!
  • 文库 | 从嬴图的技术文档聊起
  • 网络性能四大关键指标:带宽、时延、抖动和丢包率
  • vue项目中单独文件的js不存在this.$store?.state怎么办
  • 在RockyLinux9.4上安装Microk8s
  • Neo4j启动时指定JDK版本
  • Linux-异步IO和存储映射IO
  • C++《set与map》
  • websocket企业开发中常见问题及解决方案
  • 汽车软件单元测试的重要性
  • 基于Java Springboot房屋租赁App且微信小程序
  • 【LLM】Langchain+RAG大模型学习笔记
  • 什么是事件日志管理系统?事件日志管理系统有哪些用处?
  • Ollama离线迁移模型,不联网从一台电脑复制到另一台电脑
  • Vulnhub靶场 Matrix-Breakout: 2 Morpheus 练习