Linux服务器上设置http proxy代理

前提:在局域网中访问外网受限制时,需要设置http代理;以及一部分内网地址不需要走代理的情况。

1.设置全局http代理

编辑/etc/bashrc或者/etc/profile,添加环境变量

export http_proxy=http://ip:port
export https_proxy=http://ip:port

source /etc/bashrc或者source /etc/profile

2.不需要走代理的情况

同样在上述文件中添加环境变量

export no_proxy="www.foo.com,192.168.1.200"

 

posted @ 2022-12-07 16:05  晴天的柱子  阅读(198)  评论(0)    收藏  举报