I have installed Kong successfully and mapped a API by administration services provided by Kong as below:
http://kong:8001/apis
payload:
{
"upstream_url": "http://test.suraj.com:9110/"
"strip_request_path": true
"request_path": "/services_test"
"preserve_host": false
"name": "services_test"
"request_host": "test.suraj.com"
}
I am able to get this API when making get call to http://kong:8001/apis
.
now I am trying to access my API endpoints using kong like:
http://kong:8000/services_test/test.json
its returning 404 " requested resource not found" .
what I am doing wrong? I am not able to access kong's log. can anyone tell me where kong stores log files? Thanks for any help. PS: all URLs are dummy.
Finally, I got my answer.
What I doing wrong was setting strip_request_path
property true.
By enabling the strip_request_path property on an API, the requests will be proxied without the request_path property being included in the upstream request.
In my case, actual API endpoint was:
http://test.suraj.com:9110/services_test/test.json
and Kong was redirecting request to :
http://test.suraj.com:9110/test.json
because strip_request_path
property was true.
here is what documentation says about How does Kong route a request to an API
some more info from google group