Kong Manager Not Reachable via Nginx (Docker Setup)
- Dominant language
- Shell
- Stars
- 1.5k
- Forks
- 849
- PR merge metrics
- No merged PRs in 30d
Description
Hey folks 👋,
I’m new to Kong and recently set it up using the [official Docker Compose setup](https://github.com/Kong/docker-kong). Everything works fine locally, including accessing Kong Manager via localhost:8002.
However, I’m having trouble exposing the Kong Manager UI through Nginx on my host machine. Here’s my setup:
• Kong runs in Docker (compose-kong-1)
• Nginx runs on the host machine
• localhost:8002 works inside the container
• But accessing https://manager-kong.abc.com (proxy to localhost:8002) throws a 111: Connection refused error
Nginx Config
server {
listen 80;
server_name api-kong.abc.com manager-kong.abc.com;
return 301 https://$host$request_uri;
}
# Kong Proxy
server {
listen 443 ssl;
server_name api-kong.abc.com;
ssl_certificate /etc/letsencrypt/live/api-kong.abc.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/api-kong.abc.com/privkey.pem;
location / {
proxy_pass http://localhost:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
# Kong Manager
server {
listen 443 ssl;
server_name manager-kong.abc.com;
ssl_certificate /etc/letsencrypt/live/manager-kong.abc.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/manager-kong.abc.com/privkey.pem;
location / {
proxy_pass http://localhost:8002;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
Nginx Error Log
connect() failed (111: Connection refused) while connecting to upstream,
upstream: "http://127.0.0.1:8002/"
What I’ve Tried
• Verified localhost:8002 works inside the container, but not on the host
• Added KONG_MANAGER_LISTEN: "0.0.0.0:8002" in env for kong service
• Restarted containers and nginx
Question
Since Nginx is running on the host and Kong is in Docker, should I proxy to the container’s IP or expose port 8002 differently?
Any help would be appreciated! 🙏
⸻
Let me know if you want me to post it for you or if you need help editing your docker-compose or Nginx config.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the official Docker Compose setup and inspect the Kong service's published ports, then compare those bindings with the Nginx configuration shown in the issue. Verify that the host can reach port 8002 and that the manager URL works through Nginx; the issue is resolved when the host proxy connects successfully to Kong Manager.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, docker-compose, nginx
- Domain
- infrastructure, networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100