appactive-gateway/nginx-plugin/etc/nginx/conf/loc.cfg (19 lines of code) (raw):
set_by_lua_file $unit "conf/lua/set_user_unit.lua" $router_rule $unit_enable;
if ($unit = "-2") {
return 500 "wrong route condition";
}
if ($unit = "-1") {
set $unit $self_unit;
}
set $is_local_unit 1;
if ($unit != $self_unit) {
set $is_local_unit 0;
}
set $ups "${app}_${unit}";
set $cell "default";
set $ups "${ups}_${cell}";
# attention no _ in key
proxy_set_header "unit-type" $unit_type;
proxy_set_header "unit" $unit;
proxy_set_header "unit-key" $unit_key;
proxy_set_header "host" $host;
proxy_pass http://$ups;