nginx用作正向代理服务器的不多,大多都是用作反向代理服务器。
server
{
resolver 10.202.*.*;
listen 82;
location /
{
proxy_pass $scheme://$http_host$request_uri;
}
}
nginx设置正向代理服务器最简单:
1,resolver命令,解析DNS服务器
2,listen 监听端口
3,$http_host和$request_uri是nginx系统变量,客户端要访问的地址
内网客户端只要设置代理就可以(/etc/profile)
export http_proxy=http://*.*.*.*:82