Redirect http to rancher in docker container

Hello everyone. I’m trying to redirect http queries through nginx to rancher server, that running in the docker container.
Here is my setup:
Nginx container called “nginx”, eposed ports 80==>80/ 443==>443
Rancher server container, called “rancher” 8080==>8080
upstream rancher {
. . .

. . .
location /rancher {
proxy_pass http://rancher;

But when i testing this out in the browser, it’s not working. I’ve got just empty page with “Loading” in the header. In the console, i’ve seen that the webbrowser is searching site’s files in the wrong container (the nginx container, not rancher):

Why proxy_pass directive is’nt working? I’ve tryed to set different addresses in the “server” block of nginx configuration file, like: The result always is the same. Please help me.

The UI is compiled to run from the root path and does not work when you add an extra prefix to it (/rancher).

Thank you for the reply.
I’m trying to implement athentication through https. Can u give me advice, how i can do it?

location / instead of location /rancher.

1 Like

It works. Thank you very much.

Excuse me, but now i have another problem:

Why rancher sending http requests, while connection established via http?

You didn’t look at the rest of the example in the documentation, which sets headers that allow the server to know the right url to return in responses, and the UI is just following what is returned.