基于Docker版本squid搭建代理服务器的过程详解
更新时间:2024年03月01日 09:15:39 作者:快乐的GTD吧
这篇文章主要介绍了基于Docker版本squid搭建代理服务器的配置方法,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下本文给大家介绍的非常详细
基于Docker版本squid搭建代理服务器
启动容器
$ sudo docker start squid
重启容器
$ sudo docker restart squid
docker run --name squid -d --restart=always
--publish 3128:3128
--volume /srv/docker/squid/cache:/var/spool/squid
sameersbn/squid:3.5.27-2
配置
acl all src all
http_access allow all
配置文件
acl SSL_ports port 443 acl Safe_ports port 80 # http acl Safe_ports port 21 # ftp acl Safe_ports port 443 # https acl Safe_ports port 70 # gopher acl Safe_ports port 210 # wais acl Safe_ports port 1025-65535 # unregistered ports acl Safe_ports port 280 # http-mgmt acl Safe_ports port 488 # gss-http acl Safe_ports port 591 # filemaker acl Safe_ports port 777 # multiling http acl CONNECT method CONNECT http_access deny !Safe_ports http_access deny CONNECT !SSL_ports http_access allow localhost manager http_access deny manager http_access allow all http_port 3128 coredump_dir /var/spool/squid refresh_pattern ^ftp: 1440 20% 10080 refresh_pattern ^gopher: 1440 0% 1440 refresh_pattern -i (/cgi-bin/|\?) 0 0% 0 refresh_pattern (Release|Packages(.gz)*)$ 0 20% 2880 refresh_pattern . 0 20% 4320
终端下代理
export http_proxy=http://192.168.21.2:3128 && export https_proxy=http://192.168.21.2:3128
到此这篇关于基于Docker版本squid搭建代理服务器的文章就介绍到这了,更多相关Docker squid代理服务器内容请搜索脚本之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持脚本之家!
相关文章
Docker容器无法被stop or kill问题的解决方法
这篇文章主要介绍了Docker容器无法被stop or kill问题的解决方法,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧2019-09-09
docker network 自定义网络配置与管理指南详细过程
Docker网络是容器间通信和与外部世界交互的基础,通过自定义网络,可以实现容器间的隔离、静态 IP 分配和服务发现,这篇文章主要介绍了docker network 自定义网络配置与管理指南,需要的朋友可以参考下2025-05-05


最新评论