For Azure infra Kong Setup getting "message":"An invalid response was received from the upstream server" for kong service/routes with DNS names. 502 Bad gateway response

Hi,

For the azure infra VM servers we have installed Kong API gateway and trying to configure service routes using DNS names.

When we configure service route using DNS names we are getting error message (“message”:“An invalid response was received from the upstream server”) with 502 bad gateway status code. But this issue is not faced when we are using the IP address for service/route in kong.

We are facing this issue only for the new Kong setup on Azure infrastructure, but this issue is not there for our kong setup in GCP (Google cloud) infra setup.

Attached screenshot for the details.

Please support/help on this.

Thank you,
Samarendra

Have you checked the upstream service log file ?

How did you setup the service/route/upstream

Hi David, I am not sure where to check the upstream service log. I have created service, routes by providing the DNS names. Created the Upstream and added target to the upstream. Please advise or provide document link for creating upstream service.
Thank you,
Samarendra

Full Disclosure - I’m a kong user not a developer

When I’ve seen that error the actual k8s service - ie your code - is responding with an HTTP error, eg 500 - so check there first