# KONG 502 Bad Gateway: An invalid response was received from the upstream server

**URL:** <https://discuss.konghq.com/t/kong-502-bad-gateway-an-invalid-response-was-received-from-the-upstream-server/5649>\
**Category:** General\
**Tags:** kong-gateway\
**Created:** [February 26, 2020, 5:43pm UTC](https://discuss.konghq.com/t/kong-502-bad-gateway-an-invalid-response-was-received-from-the-upstream-server/5649 "2020-02-26T17:43:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rajashree](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/rajashree/32/1746_2.png) [@rajashree](https://discuss.konghq.com/u/rajashree)\
**Post date:** [February 26, 2020, 5:43pm UTC](https://discuss.konghq.com/t/kong-502-bad-gateway-an-invalid-response-was-received-from-the-upstream-server/5649/1 "2020-02-26T17:43:16Z")

</div>

Hi,

I’m trying to add below routes. But Im getting Bad Gateway error. Could anyone please tell me whether I’m doing it right?  
Route 1:

```
		"created_at": 1582737451768,
		"strip_uri": true,
		"id": "49a9c240-bc92-47dc-ad43-204f17c9a076",
		"name": "dataupload",
		"http_if_terminated": false,
		"https_only": false,
		"upstream_url": "http:// ***.*** :8282",
		"uris": [
			"/example/api/v1/foo"
		],
		"preserve_host": true,
		"upstream_connect_timeout": 60000,
		"upstream_read_timeout": 60000,
		"upstream_send_timeout": 60000,
		"retries": 5

```

Here I can hit my api successfully from https://\*\*\*/example/api/v1/foo/13456/token/upload?threshold=6

Route 2:  
“created\_at”: 1582737920412,  
“strip\_uri”: true,  
“id”: “8578183a-fe68-448d-a117-ae2cbc1e502e”,  
“name”: “uploadbatch”,  
“http\_if\_terminated”: false,  
“https\_only”: false,  
“upstream\_url”: “http://_ **.** _:9090”,  
“uris”: [  
“/example/api/v1/batch”  
],  
“preserve\_host”: true,  
“upstream\_connect\_timeout”: 60000,  
“upstream\_read\_timeout”: 60000,  
“upstream\_send\_timeout”: 60000,  
“retries”: 5

In this route, the request is not gone through KONG. Im getting An invalid response was received from the upstream server  
URL trying to hit: https://\*\*\*\*/example/api/v1/batch/2014bdf5-e2d2-4976-ac79-a8dd3602f4c9

Thanks in Advance!!
