搭载代理服务器
在传递参数添加指定变量值例如serverid=x,在nginx配置中添加这个变量的映射关系,
map $arg_serverid $source{
x ip
}
map $arg_serverid $myhost{
x host
}
server中添加location配置
location /{
proxy_set_header Host $myhost;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_ignore_headers Cache-Control Expires Set-Cookie X-Accel-Expires;
proxy_pass http://$source;
}
转载于:https://blog.51cto.com/ample/1895363