-
Notifications
You must be signed in to change notification settings - Fork 849
Description
Hey folks 👋,
I’m new to Kong and recently set it up using the official Docker Compose setup. 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.