Kong 1.4.0 - Using X-Kong-Debug: 1 doesn't seem to work


I saw in the Kong 1.4.0 documentation https://docs.konghq.com/1.4.x/proxy/#evaluation-order, that you can send X-Kong-Debug: 1 in the request header and it will indicate the matched Route ID in the response headers for troubleshooting purposes. I’m not seeing that in my scenario. Below is my curl GET request with the X-Kong-Debug as part of the header.

curl -i GET --url http://localhost:8000/ --header 'Host: mycooldomain.com' --header 'X-Kong-Debug: 1'

The response I get is the following:

* Rebuilt URL to: GET/
* Could not resolve host: GET
* Closing connection 0
curl: (6) Could not resolve host: GET
*   Trying ::1...
* Connected to localhost (::1) port 8000 (#1)
> GET / HTTP/1.1
> Host: mycooldomain.com
> User-Agent: curl/7.54.0
> Accept: */*
> X-Kong-Debug: 1
< HTTP/1.1 301 Moved Permanently
HTTP/1.1 301 Moved Permanently
< Content-Type: text/html; charset=iso-8859-1
Content-Type: text/html; charset=iso-8859-1
< Content-Length: 229
Content-Length: 229
< Connection: keep-alive
Connection: keep-alive
< Date: Tue, 19 Nov 2019 13:23:28 GMT
Date: Tue, 19 Nov 2019 13:23:28 GMT
< Server: Apache/2.4.6 (CentOS) PHP/5.4.16 OpenSSL/1.0.2k-fips
Server: Apache/2.4.6 (CentOS) PHP/5.4.16 OpenSSL/1.0.2k-fips
< Location: https://www.mycooldomain.com/
Location: https://www.mycooldomain.com/
< Via: kong/1.4.0
Via: kong/1.4.0
< Vary: Accept-Encoding
Vary: Accept-Encoding
< X-Cache: Hit from cloudfront
X-Cache: Hit from cloudfront
< X-Amz-Cf-Pop: IAD53
X-Amz-Cf-Pop: IAD53
< X-Amz-Cf-Id: sdfas-D1Dsd2fsdM_fDq2sdfs==
X-Amz-Cf-Id: sdfas-D1Dsd2fsdM_fDq2sdfs==
< Age: 1821
Age: 1821
< X-Kong-Upstream-Latency: 151
X-Kong-Upstream-Latency: 151
< X-Kong-Proxy-Latency: 1
X-Kong-Proxy-Latency: 1

<title>301 Moved Permanently</title>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="https://www.mycooldomain.com/">here</a>.</p>
* Connection #1 to host localhost left intact

Any suggestions on what I may be doing wrong that I don’t see the matched Route ID in the response headers?


Seeing if anybody has ideas on why this doesn’t seem to work.

Thank you.

I believe the undocumented header is kong-debug: 1.

Hello @hbagdi,

Using kong-debug: 1 worked. Thank you.

Below is my test using that debug.

curl -i GET --url http://localhost:8000/ --header 'Host: mycooldomain.com' --header 'kong-debug: 1'

The info in the output looked similar to this below:

   Kong-Route-Id: c921367b-6596-4125-bd10-fb42044c8fb8
   Kong-Service-Id: d260b894-78db-41e2-8763-934c7cfbf619
   Kong-Service-Name: my-cool-service