NIRAJ KUMAR
NIRAJ KUMAR

Reputation: 171

Kong {"message":"no Route matched with those values"}

I had tried https://docs.konghq.com/getting-started-guide/2.1.x/expose-services/ as well I have locally Server: kong/2.2.1 I am able to register service and router both but when I am calling the kong to redirect its giving below error.

service registered:

{
    "host": "localhost",
    "id": "2546864e-6ac0-41e5-b39f-b05310ac53f8",
    "protocol": "http",
    "read_timeout": 60000,
    "tls_verify_depth": null,
    "port": 16001,
    "updated_at": 1607946666,
    "ca_certificates": null,
    "created_at": 1607946666,
    "connect_timeout": 60000,
    "write_timeout": 60000,
    "name": "newkong",
    "retries": 5,
    "path": null,
    "tls_verify": null,
    "tags": null,
    "client_certificate": null
}

router registered :

{
    "id": "726eec9e-b179-4731-937f-e85a10101987",
    "tags": null,
    "paths": [
        "/customer"
    ],
    "destinations": null,
    "headers": null,
    "protocols": [
        "http",
        "https"
    ],
    "strip_path": true,
    "created_at": 1607946800,
    "request_buffering": true,
    "hosts": null,
    "name": "newkong-routing",
    "updated_at": 1608446942,
    "snis": null,
    "preserve_host": false,
    "regex_priority": 0,
    "methods": null,
    "sources": null,
    "response_buffering": true,
    "https_redirect_status_code": 426,
    "path_handling": "v0",
    "service": {
        "id": "2546864e-6ac0-41e5-b39f-b05310ac53f8"
    }
}

calling for kong on: http://localhost:8000/customer/1

so that it can redirect to http://localhost:16001/customer/1

{"message":"no Route matched with those values"}

Upvotes: 3

Views: 19633

Answers (1)

Tieske
Tieske

Reputation: 406

from a first glance this ought to work. except that the upstream path will be stripped, since the route has "strip_path": true.

{
  "paths": [
    "/customer"
  ],
  "methods": null,
  "hosts": null,
  "snis": null,
  "headers": null,
  "protocols": [
    "http",
    "https"
  ],
  "strip_path": true,
  "created_at": 1607946800,
  "request_buffering": true,
  "name": "newkong-routing",
  "updated_at": 1608446942,
  "preserve_host": false,
  "regex_priority": 0,
  "sources": null,
  "response_buffering": true,
  "https_redirect_status_code": 426,
  "path_handling": "v0",
  "id": "726eec9e-b179-4731-937f-e85a10101987",
  "destinations": null,
  "tags": null,
  "service": {
    "id": "2546864e-6ac0-41e5-b39f-b05310ac53f8"
  }
}

Since the only routing properties set are "protocols" and "paths" it should work. Are you sure this is correct?

When making request:

http://localhost:8000/customer/1

It should proxy towards:

http://localhost:16001/1

because the path element that is matched (/customer) is being stripped.

Upvotes: 2

Related Questions