【发布时间】:2018-08-20 01:40:59
【问题描述】:
我使用 docker 设置了一个 Kong,它运行良好。我使用以下信息配置了本地服务;
{
"host": "localhost",
"created_at": 1534727577,
"connect_timeout": 60000,
"id": "cc3a858f-09fc-4baa-a206-3bd5ad3f514a",
"protocol": "http",
"name": "iwc_client_management",
"read_timeout": 60000,
"port": 9007,
"path": "/rfg/iwconnect/1.0",
"updated_at": 1534727577,
"retries": 5,
"write_timeout": 60000
}
我还使用以下信息为此服务创建了一条路线;
{
"created_at": 1534727699,
"strip_path": true,
"hosts": [
"iwconnect.com"
],
"preserve_host": false,
"regex_priority": 0,
"updated_at": 1534727699,
"paths": [
"/clients"
],
"service": {
"id": "cc3a858f-09fc-4baa-a206-3bd5ad3f514a"
},
"methods": null,
"protocols": [
"http",
"https"
],
"id": "67c32503-e5d1-4aae-982b-bfa03a36582e"
}
根据这个例子,
Let's go through a few examples。考虑这样配置的路由:
{
"hosts": ["iwconnect.com"],
"paths": ["/clients],
"methods": ["GET"]
}
根据 Kong 文件,以下调用将生效;
获取http://localhost:8000/clients 标题: 主机:iwconnect.com
但响应是:
error_404
{
"message": "no route and no API found with those values"
}
我有什么遗漏或错误的配置吗?
感谢您的帮助。
【问题讨论】: