하위 경로를 기반으로 nginx를 리디렉션하는 방법은 무엇입니까?

하위 경로를 기반으로 nginx를 리디렉션하는 방법은 무엇입니까?

동일한 Azure VM에서 Grafana와 Jenkins가 실행되고 있습니다. 젠킨스의 경우: http://localhost:8080 그라파나의 경우: http://localhost:3000

나는 nginx를 그런 식으로 설정하려고 생각했습니다. customdomain.com/grafana는 http://localhost:3000으로 이동해야 합니다. customdomain.com/jenkins 또는 customdomain.com은 http://localhost:8080으로 이동해야 합니다.

하지만 /grafana도 젠킨스에만 사용됩니다.

문제를 해결하는 방법은 무엇입니까?

nginx의 매핑을 위한 기본 구성 파일입니다.

 location /grafana {
                include /etc/nginx/proxy_params;
                proxy_pass          http://localhost:3000;
                proxy_read_timeout  60s;
        # Fix the "It appears that your reverse proxy set up is broken" error.
        # Make sure the domain name is correct
                #proxy_redirect      http://localhost:3000 https://customdomain.com;
        }

        location / {
                include /etc/nginx/proxy_params;
                proxy_pass          http://localhost:8080;
                proxy_read_timeout  60s;
        # Fix the "It appears that your reverse proxy set up is broken" error.
        # Make sure the domain name is correct
                proxy_redirect      http://localhost:8080 https://customdomain.com;
        }

관련 정보