502 error Bad Gateway after installing reverse proxy

0

I have installed the reverse proxy with this config file in /etc/nginx/sites-available:

server { listen 80; listen [::]:80; server_name example.com;

location /drivers   {

    proxy_pass http://127.0.0.1:5000;
    proxy_redirect http://127.0.0.1:5000/ http://example.com/drivers/ ;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade" ;
    proxy_read_timeout 20d ;
    proxy_buffering off ;
}

}

When accessing http://127.0.0.1:5000, everything is working fine. But http://example.com/drivers leads to 502 error

Thanks a lot for your help

preguntada hace un año64 visualizaciones
No hay respuestas

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas