I have two HTTP endpoint as follow
http://me11.example.local/api/foo
http://me11.example.local/api/boo
I want to redirect them to two different endpoints. In my config file it works for only one URL. how do I configure this for both endpoints? my Nginx config file looks as below
server {
listen 80;
listen [::]:80;
server_name me11.example.local;
location /{
rewrite ^/api/foo / last;
proxy_pass http:localhost:5000;
}
location /{
rewrite ^/api/boo / last;
proxy_pass http:localhost:6000;
}
}
With this config I received the following error
duplicate location and so on
If I remove one location block it works fine but I need this to function for both endpoints.
How would I solve this issue?