nginx – Removing location without removing the rest of the path

According to many old posts here and in other places on the internet, the following nginx configuration should proxy http://nginx-service/foo/bar to http://web.default.svc.cluster.local:8080/bar.

In other words, it should strip the /foo part in the path (the location matched) while appending the rest (/bar) when proxying it on.

That is not what I observe in practice; the full path is removed and / is proxied on.

How could I proxy this to the upstream service while keeping /bar?

Read more here: Source link