A 404 with "no Route matched" comes from Kong, not from the backend. Kong found no route matching the request's path, host, method or headers.
Symptom
curl -si $PROXY/echo/get HTTP/1.1 404 Not Found … X-Kong-Response-Latency: 1 Server: kong/3.9.4 X-Kong-Request-Id: b2125431af0d135323c16d3c1cad392f
A fresh Kong without configuration receives a request for /echo/get.
Diagnosis
Read the body: the message and the request_id come from Kong.
{
"message":"no Route matched with those values",
"request_id":"b2125431af0d135323c16d3c1cad392f"
}
Causes
no routeRoute missing or not matching
Kong compares path, host, method and headers with all routes. If none matches, Kong answers with 404 before any service is asked.
X-Kong-Response-LatencyKong answered itself
This header is only set on responses Kong generates itself. If the 404 comes from the backend, it is missing.
Fix
mkdir -p ~/kong-lab/tag01 && cd ~/kong-lab/tag01
Don't: Looking for the 404 in the backend – the request never arrived there.
Kong hands-on, Day 1: starting Kong, Admin API and proxy, DB-less, configuration in memory and as a file, Kong Manager.
Go to day 1 →
FAQ
What is the request_id good for?
It appears in the response and in the Kong log and links client and gateway during troubleshooting.
Why does my route not match despite the right path?
Often hosts, methods or headers of the route restrict it further. All conditions of a route must match.