# 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

**URL:** <https://discuss.konghq.com/t/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/11163>\
**Category:** General\
**Tags:** kong-gateway\
**Created:** [February 3, 2023, 1:16pm UTC](https://discuss.konghq.com/t/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/11163 "2023-02-03T13:16:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![samarendra.java](https://avatars.discourse-cdn.com/v4/letter/s/278dde/32.png) [@samarendra.java](https://discuss.konghq.com/u/samarendra.java)\
**Post date:** [February 3, 2023, 1:16pm UTC](https://discuss.konghq.com/t/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/11163/1 "2023-02-03T13:16:59Z")

</div>

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

 ![kong_error_502](https://canada1.discourse-cdn.com/flex036/uploads/konghq/original/2X/c/cc3d7dce65d76d2efe992f4057e16c9ecaec5815.png)

---

<div class="post-metadata">

**Author:** ![David\_Betterton](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/david_betterton/32/3615_2.png) [@David\_Betterton](https://discuss.konghq.com/u/David_Betterton)\
**Post date:** [February 7, 2023, 4:41pm UTC](https://discuss.konghq.com/t/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/11163/2 "2023-02-07T16:41:02Z")

</div>

Have you checked the upstream service log file ?

How did you setup the service/route/upstream

---

<div class="post-metadata">

**Author:** ![samarendra.java](https://avatars.discourse-cdn.com/v4/letter/s/278dde/32.png) [@samarendra.java](https://discuss.konghq.com/u/samarendra.java)\
**Post date:** [February 8, 2023, 9:31am UTC](https://discuss.konghq.com/t/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/11163/3 "2023-02-08T09:31:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![David\_Betterton](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/david_betterton/32/3615_2.png) [@David\_Betterton](https://discuss.konghq.com/u/David_Betterton)\
**Post date:** [February 8, 2023, 3:02pm UTC](https://discuss.konghq.com/t/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/11163/4 "2023-02-08T15:02:36Z")

</div>

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
