I have setup Kong API gateway following the documentation here. With the curl command below, I can confirm that Kong is up and responding via 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
My question is, for production, how to configure Kong to respond to DNS/URL?
I have set up a DNS record on AWS Route 53 to point traffic at the IP of this server where Kong is deployed. With a standalone application - a Node/Express app for exmaple, I would set up a reverse proxy ie NGINX to route requests received to the server from a URL onwards to the app. However, as Kong is the API gateway, that wouldn't be appropriate.
To summarise;
- I want to make an API request from a client to the gateway at: http://my-gateway-url.com/service-name/route
- This request should be handled by Kong and processed by the configured service. How do I configure Kong to listen at http://my-gateway-url.com ?
If you want to route based on the host, this is a classic feature.
First create a service (your node application):
Then create a route:
Then you can test the route is matched
compared to
Another thing to check is which port you cant to expose 80 or 8000, and check that the route is open on your security level (Security group on AWS for example).