Dockerized Kong API forward request Issue|HTTP 503 Error|

Please help me as I am getting “503 Service Temporarily Unavailable” error on getting the data from REST endpoint using Dockerized Kong.

REST service that I am trying to access using Kong is running on my local machine (DESKTOP-2IQC7RC).

Kong Request to add API :

curl -i -X POST
–url http://localhost:8001/apis/
–data ‘name=my-api’
–data ‘uris=/employee’
–data ‘upstream_url=http://DESKTOP-2IQC7RC:8080/v1/employee/ping’

Error that I am getting on forwarding the request through Kong:

[root@c1c865250782 /]# curl -v -X GET --url http://localhost:8000/employee
*** About to connect() to localhost port 8000 (#0)**
*** Trying 127.0.0.1…**
*** Connected to localhost (127.0.0.1) port 8000 (#0)**
> GET /employee HTTP/1.1
> User-Agent: curl/7.29.0
> Host: localhost:8000
> Accept: /
>
< HTTP/1.1 503 Service Temporarily Unavailable
< Date: Mon, 01 Jan 2018 14:13:17 GMT
< Content-Type: application/json; charset=utf-8
< Transfer-Encoding: chunked
< Connection: keep-alive
< Server: kong/0.11.2
<
{“message”:“Service unavailable”}
*** Connection #0 to host localhost left intact**

Please help me to solve this issue.

Thanks, Kamal

Hi,

With that configuration you are attempting to access http://DESKTOP-2IQC7RC:8080/v1/employee/ping/employees (notice the /employee/ping/employees part). Is that URL correct? Does it work without using kong, or do you also get a 503 with that one?

Hi, I met the same problem, but if I set the Host in http header, then I can call the api. Do you find another way to call it?