nginx动态转发到upstream
nginx动态转发到upstream
背景
目标
方案
location /dispatch {
allow 192.168.0.0/16; # 只允许内网访问
deny all;
set_unescape_uri $dispatch_up $arg_up;
set_unescape_uri $dispatch_path $arg_path;
rewrite (.*)$ $dispatch_path break;
proxy_set_header path $dispatch_path;
proxy_set_header upstream $dispatch_up;
proxy_pass http://$dispatch_up;
}最后更新于