在nginx.conf中加一项
#代理上网
server
{
resolver 223.6.6.6;
listen 82;
location / {
proxy_pass http://$http_host$request_uri;
}
}
linux电脑配置代理服务
//编辑配置文件
vi /etc/profile
#在该配置文件的最后添加代理配置
export http_proxy='http://192.168.16.44:82' #代理服务器ip地址和端口号
export https_proxy='http://192.168.16.44:82' #代理服务器ip地址和端口号
export no_proxy='localhost,192.168.*,127.0.0.1,::1'
// 退出profile文件并保存
source /etc/profile // 使配置文件生效
通过上面的代码操作即可配置centos通过代理进行上网
而对于要取消设置可以使用如下命令,其实也就是取消环境变量的设置:
unset http_proxy unset https_proxy unset ftp_proxy unset no_proxy