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

asked a year ago62 views
No Answers

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions