基于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
到此這篇關(guān)于基于Docker版本squid搭建代理服務器的文章就介紹到這了,更多相關(guān)Docker squid代理服務器內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
Docker容器無法被stop or kill問題的解決方法
這篇文章主要介紹了Docker容器無法被stop or kill問題的解決方法,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧2019-09-09
docker network 自定義網(wǎng)絡配置與管理指南詳細過程
Docker網(wǎng)絡是容器間通信和與外部世界交互的基礎,通過自定義網(wǎng)絡,可以實現(xiàn)容器間的隔離、靜態(tài) IP 分配和服務發(fā)現(xiàn),這篇文章主要介紹了docker network 自定義網(wǎng)絡配置與管理指南,需要的朋友可以參考下2025-05-05

