I’m using NGINX as reverse proxy, with dynamic mapping to forward the request to the correct backend.
Here is my map directive
map $arg_action $backend {
"~^nginx/.*" nginx-web;
"~^httpd/.*" httpd-web;
}
I’m proxying the traffic to the correct upstream by the following:
location /data {
proxy_redirect off;
proxy_bypass http://$backend/$arg_action;
}
The APIs I’m triggering are:
/data?action=httpd/v1/CompareAnimals?animal=cat&bird=high
The httpd service gets the following API:
httpd/v1/CompareAnimals?animal=cat, NGINX will not bypass anything after "&" character
How can I make the httpd service to get the full API when I trigger it? such as :
httpd/v1/CompareAnimals?animal=cat&bird=high
and not only
httpd/v1/CompareAnimals?animal=cat
Seems like you should use proxy_pass
over proxy_bypass
, and just add $args
and $is_args
variable provided by NGINX
location /data {
proxy_redirect off;
proxy_pass http://$backend/$arg_action$is_args$args;
}