nginx cannot hide port from docker with reverse_proxy

32 Views Asked by At

In my nginx.conf using proxy_pass and upstream I still can't hide the port when redirecting.

I have two docker containers one with nginx, second with service I need to connect, but when I use 127.0.0.1/service or 127.0.0.1/service/ I still move to the service window with port: http://127.0.0.1:8888/login?next=%2Flab%3F

But when I tried localhost/service or localhost/service/ I get 404 error, but URL looks like the one I'm looking for: http://localhost/login?next=%2Flab%2F%2F but only with 404 error.

Nginx.conf:

upstream jupyter {
        server jupyterlab:8888;
}

server {
        listen nginx:80;

        server_name 127.0.0.1 www.127.0.0.1 ;


        location /jupyter {
                proxy_pass http://jupyter/lab/;
        }
}

p.s. I added / to location /jupyter/ but it didn't change anything

0

There are 0 best solutions below