Dynamic Routing for Apicast
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
692 B

location = /dummy {
set $catalog_url "http://catalog_upstream";
set $catalog_host "catalog_upstream";
set $service_name "dummy";
set $environment "bogus";
}
location = /dynamic-router {
internal;
set $path /catalog/services/$service_name/environments/$environment/target;
proxy_pass $catalog_url$path;
proxy_pass_request_headers off;
proxy_pass_request_body off;
proxy_http_version 1.1;
proxy_set_header Host "$catalog_host";
proxy_set_header Connection "";
proxy_set_header Content-Length "";
#rewrite_by_lua_block {
# ngx.log(ngx.WARN, "service_name = " .. ngx.var.service_name)
# ngx.var.real_url = ngx.var.catalog_url .. ngx.var.path
#}
}