正向代理服务器nginx, squid, tinyproxy

正向代理服务

  • 正向代理服务器比较
    • NGINX
    • Squid
    • Tinyproxy

正向代理服务器比较

两台安装有docker的机器,一台能访问外网,一台不能。
用能访问外网的机器做代理。另一台机器配置docker 代理

NGINX

配置两个server, 使用80,443端口
总结:正向代理 400错误,不能做 https代理

Squid

docker-compose.yml

version: "3"
services:
    squid-common:
        image: sameersbn/squid
        restart: always 
        ports:
            - 3128:3128 
        volumes:
            - ./conf/squid.conf:/etc/squid3/squid.conf
            - ./spool/cache:/var/spool/squid3
            - ./log/squid3:/var/log/squid 
            - /etc/localtime:/etc/localtime

配置文件

acl CONNECT method CONNECT
http_access allow all
http_port 3128
dns_nameservers 8.8.8.8 8.8.4.4
visible_hostname proxy

总结:squid代理403错误,暂未解决

Tinyproxy

总结:OK

  1. 安装
yum install tinyproxy
  1. /etc/tinyproxy/tinyproxy.conf
    Allow 127.0.0.1 指定允许的IP,或者注释掉
  2. 常用命令
 systemctl restart tinyproxy.service
 systemctl stop tinyproxy.service
 systemctl status tinyproxy.service
 systemctl enable tinyproxy.service
  1. 内网docker配置代理
    /etc/systemd/system/docker.service.d/http-proxy.conf
Environment="HTTPS_PROXY=xx.xx.xx.xx:12015" 
Environment="HTTP_PROXY=xx.xx.xx.xx:12015" 
Environment="NO_PROXY=localhost,127.0.0.1,docker-registry.somecorporation.com"

你可能感兴趣的:(正向代理,代理服务器,docker)