Oathkeeper giving "Access request denied because roundtrip failed" error for upstream server connection


Hi There,

I’m using oathkeeper to connect to a upstream server which is running on localhost. But it gives me error saying below.

time=“2019-07-07T05:12:50Z” level=info msg=“started handling request” method=GET remote=“” request=/test/a
time=“2019-07-07T05:12:50Z” level=warning msg=“Access request denied because roundtrip failed” access_url=“” error=“dial tcp connect: connection refused” granted=false
2019/07/07 05:12:50 http: proxy error: dial tcp connect: connection refused
time=“2019-07-07T05:12:50Z” level=info msg=“completed handling request” measure#oathkeeper-proxy.latency=93853298 method=GET remote=“” request=/test/a status=502 text_status=“Bad Gateway” took=93.853298ms

Can anybody please help me.