Score:0

Nginx reverse proxy dropping /foo in URL

in flag

Having an issue with a Nginx reverse proxy.

My current config:

location /foo/ {
    proxy_pass   http://10.0.0.1:1234/;
}

The service is accessed without the reverse proxy by going to http://10.0.0.1:1234/login. Currently, going to the reverse proxy initially goes to https://example.com/foo, but it immediately gets redirected to https://example.com/login. I need Nginx to show in the browser https://example.com/foo/login since there are other locations on this reverse proxy, but I need the URL used behind the proxy to be http://10.0.0.1:1234/login.

So, how can I configure this location to redirect from https://example.com/foo/login while actually going to http://10.0.0.1:1234/login, showing the /foo in the users browser while actually dropping that when calling the service behind the proxy.

Apologies on this probably being phrase very badly.

in flag
Configure the baseurl of your backend service with the `https://example.com/foo` URL.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.