在国外服务器(B)上安装 Squid
yum install -y squid
systemctl start squid
systemctl enable squid

修改 Squid 配置(允许国内服务器 A 访问) 编辑 /etc/squid/squid.conf
http_port 3128
acl localnet src 国内服务器A的IP
http_access allow localnet
http_access deny all
重启 Squid:
systemctl restart squid
在国内服务器上执行
export http_proxy=http://美国服务器B的IP:3128
export https_proxy=http://美国服务器B的IP:3128
取消代理
unset http_proxy
unset https_proxy
测试下载
curl -fsSL https://ollama.com/install.sh | sh