问题描述
我已经按照文档 here 设置了 Kong API 网关。 使用下面的 curl 命令,我可以确认 Kong 已启动并通过 localhost 响应。
curl -i http://localhost:8001/services
HTTP/1.1 200 OK
Date: Thu,13 May 2021 15:39:32 GMT
Content-Type: application/json; charset=utf-8
Connection: keep-alive
Access-Control-Allow-Origin: http://localhost:8002
X-Kong-Admin-Request-ID: xeUkwshQPRXA5T9bPQmxsmPcspJCGU2L
vary: Origin
Access-Control-Allow-Credentials: true
Content-Length: 23
X-Kong-Admin-Latency: 5
Server: kong/2.3.3.2-enterprise-edition
我的问题是,对于生产,如何配置 Kong 以响应 DNS/URL?
我在 AWS Route 53 上设置了 DNS 记录,以将流量指向部署了 Kong 的服务器的 IP。 使用一个独立的应用程序 - 例如一个 Node/Express 应用程序,我会设置一个反向代理,即 NGINX 来将收到的请求从 URL 路由到应用程序。 但是,由于 Kong 是 API 网关,因此不合适。
总结;
- 我想从客户端向网关发出 API 请求:http://my-gateway-url.com/service-name/route
- 此请求应由 Kong 处理并由配置的服务处理。 如何配置 Kong 以在 http://my-gateway-url.com 收听?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)