[GH-ISSUE #649] Local resources - Bad Gateway #1549

Closed
opened 2026-04-16 08:12:47 -05:00 by GiteaMirror · 20 comments
Owner

Originally created by @pong106 on GitHub (May 3, 2025).
Original GitHub issue: https://github.com/fosrl/pangolin/issues/649

Having Bad Gateway error when I spin up Portainer beside Pangolin. I setup using local site and resource with 127.0.0.1:9111. Cant see any error in any loggings. Traefik dashboard works with the same method. Did not modify any gerbil settings.

docker-compose

services:
  portainer:
    image: portainer/portainer-ce:lts
    command: -H unix:///var/run/docker.sock
    restart: always
    networks:
      - pangolin
    ports:
      - "9111:9000"
      - "9443:9443"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - portainer_data:/data

volumes:
  portainer_data:

networks:
  pangolin:
    external: true
Originally created by @pong106 on GitHub (May 3, 2025). Original GitHub issue: https://github.com/fosrl/pangolin/issues/649 Having `Bad Gateway` error when I spin up Portainer beside Pangolin. I setup using `local` site and `resource` with `127.0.0.1:9111`. Cant see any error in any loggings. Traefik dashboard works with the same method. Did not modify any `gerbil` settings. docker-compose ``` services: portainer: image: portainer/portainer-ce:lts command: -H unix:///var/run/docker.sock restart: always networks: - pangolin ports: - "9111:9000" - "9443:9443" volumes: - /var/run/docker.sock:/var/run/docker.sock - portainer_data:/data volumes: portainer_data: networks: pangolin: external: true ```
Author
Owner

@hermanops commented on GitHub (May 3, 2025):

create resource with port 9443?

<!-- gh-comment-id:2848749597 --> @hermanops commented on GitHub (May 3, 2025): create resource with port 9443?
Author
Owner

@pong106 commented on GitHub (May 4, 2025):

create resource with port 9443?

tried with both 9111 and 9443 , same error.

<!-- gh-comment-id:2848907654 --> @pong106 commented on GitHub (May 4, 2025): > create resource with port 9443? tried with both 9111 and 9443 , same error.
Author
Owner

@calim20 commented on GitHub (May 9, 2025):

Same here. I tried it with two different services, nginx and uptime-kuma. After authentication I get Bad Gateway.

I have created a local site with two resources. The nginx container I've started with docker run (docker run -it --rm -d -p 8082:80 --name web nginx) and for uptime-kuma I've used docker compose.

docker-compose.yml

services:
  uptime-kuma:
    restart: always
    ports:
      - 127.0.0.1:5001:3001
    volumes:
      - /data/uptime:/app/data
    container_name: uptime-kuma
    image: louislam/uptime-kuma:1

I've setup pangolin with crowdsec.

Best,
Marco

<!-- gh-comment-id:2865978166 --> @calim20 commented on GitHub (May 9, 2025): Same here. I tried it with two different services, nginx and uptime-kuma. After authentication I get `Bad Gateway`. I have created a `local` site with two resources. The nginx container I've started with `docker run` (`docker run -it --rm -d -p 8082:80 --name web nginx`) and for uptime-kuma I've used `docker compose`. docker-compose.yml ``` services: uptime-kuma: restart: always ports: - 127.0.0.1:5001:3001 volumes: - /data/uptime:/app/data container_name: uptime-kuma image: louislam/uptime-kuma:1 ``` I've setup pangolin with crowdsec. Best, Marco
Author
Owner

@noahcub commented on GitHub (May 10, 2025):

Same problem here

<!-- gh-comment-id:2869005915 --> @noahcub commented on GitHub (May 10, 2025): Same problem here
Author
Owner

@danielholm commented on GitHub (May 10, 2025):

Same here. Tried adding Pangolin and other local services to same docket net without avail.

<!-- gh-comment-id:2869021594 --> @danielholm commented on GitHub (May 10, 2025): Same here. Tried adding Pangolin and other local services to same docket net without avail.
Author
Owner

@ashleycameron commented on GitHub (May 11, 2025):

Same here with this Portainer setup in VPS:

  • Access stack (pangolin, gerbil, traefik containers)
  • Dummy stack (speedtest)

Portainer access works, as does remoting in to my homelab via Newt.
But creating a local site I can never resolve to target using the Pangolin-defined resource path, even though the resource is available if I access it via the server IP:port directly.

Steps tried:

  • Creating a custom bridging network in Portainer for my Acccess stack + Dummy stack
  • Accessing variants of local host / fixed local ip's / running all containers on network_mode: host
  • Different cloudflare dns routing options from wildcard to specific domain omitted / included
<!-- gh-comment-id:2870205613 --> @ashleycameron commented on GitHub (May 11, 2025): Same here with this Portainer setup in VPS: - Access stack (pangolin, gerbil, traefik containers) - Dummy stack (speedtest) Portainer access works, as does remoting in to my homelab via Newt. But creating a local site I can never resolve to target using the Pangolin-defined resource path, even though the resource is available if I access it via the server IP:port directly. Steps tried: - Creating a custom bridging network in Portainer for my Acccess stack + Dummy stack - Accessing variants of local host / fixed local ip's / running all containers on network_mode: host - Different cloudflare dns routing options from wildcard to specific domain omitted / included
Author
Owner

@oloev commented on GitHub (May 11, 2025):

I setup using local site and resource with 127.0.0.1:9111

Here 127.0.0.1 means literally Traefik localhost, not host machine localhost.
Try docker0 interface IP, in most cases it is 172.17.0.1.
If you don't want docker container port to be exposed directly to the internet, you can bind port using - "172.17.0.1:9111:9000"

<!-- gh-comment-id:2870217835 --> @oloev commented on GitHub (May 11, 2025): > I setup using local site and resource with 127.0.0.1:9111 Here 127.0.0.1 means literally Traefik localhost, not host machine localhost. Try docker0 interface IP, in most cases it is 172.17.0.1. If you don't want docker container port to be exposed directly to the internet, you can bind port using `- "172.17.0.1:9111:9000"`
Author
Owner

@ashleycameron commented on GitHub (May 11, 2025):

I setup using local site and resource with 127.0.0.1:9111

Here 127.0.0.1 means literally Traefik localhost, not host machine localhost. Try docker0 interface IP, in most cases it is 172.17.0.1. If you don't want docker container port to be exposed directly to the internet, you can bind port using - "172.17.0.1:9111:9000"

When I try 172.17.0.1 the error changes to Gateway timeout at least and doesn't just immediately fail at Bad gateway

<!-- gh-comment-id:2870219936 --> @ashleycameron commented on GitHub (May 11, 2025): > > I setup using local site and resource with 127.0.0.1:9111 > > Here 127.0.0.1 means literally Traefik localhost, not host machine localhost. Try docker0 interface IP, in most cases it is 172.17.0.1. If you don't want docker container port to be exposed directly to the internet, you can bind port using `- "172.17.0.1:9111:9000"` When I try 172.17.0.1 the error changes to Gateway timeout at least and doesn't just immediately fail at Bad gateway
Author
Owner

@oloev commented on GitHub (May 11, 2025):

I setup using local site and resource with 127.0.0.1:9111

Here 127.0.0.1 means literally Traefik localhost, not host machine localhost. Try docker0 interface IP, in most cases it is 172.17.0.1. If you don't want docker container port to be exposed directly to the internet, you can bind port using - "172.17.0.1:9111:9000"

When I try 172.17.0.1 the error changes to Gateway timeout at least and doesn't just immediately fail at Bad gateway

What is your docker0 ip?
What ports do you see after running docker ps?

<!-- gh-comment-id:2870222866 --> @oloev commented on GitHub (May 11, 2025): > > > I setup using local site and resource with 127.0.0.1:9111 > > > > > > Here 127.0.0.1 means literally Traefik localhost, not host machine localhost. Try docker0 interface IP, in most cases it is 172.17.0.1. If you don't want docker container port to be exposed directly to the internet, you can bind port using `- "172.17.0.1:9111:9000"` > > When I try 172.17.0.1 the error changes to Gateway timeout at least and doesn't just immediately fail at Bad gateway What is your docker0 ip? What ports do you see after running `docker ps`?
Author
Owner

@ashleycameron commented on GitHub (May 11, 2025):

I setup using local site and resource with 127.0.0.1:9111

Here 127.0.0.1 means literally Traefik localhost, not host machine localhost. Try docker0 interface IP, in most cases it is 172.17.0.1. If you don't want docker container port to be exposed directly to the internet, you can bind port using - "172.17.0.1:9111:9000"

When I try 172.17.0.1 the error changes to Gateway timeout at least and doesn't just immediately fail at Bad gateway

What is your docker0 ip? What ports do you see after running docker ps?

docker0 ip : 172.17.0.1

docker ps ports:

[pangolin] : empty
[traefik] : empty
[gerbil] : 0.0.0.0:80->80/tcp, [::]:80->80/tcp, 0.0.0.0:443->443/tcp, [::]:443->443/tcp, 0.0.0.0:51820->51820/udp, [::]:51820->51820/udp
[dummy stack] : 3000/tcp, 8080/tcp, 0.0.0.0:3201->3001/tcp, [::]:3201->3001/tcp
<!-- gh-comment-id:2870225066 --> @ashleycameron commented on GitHub (May 11, 2025): > > > > I setup using local site and resource with 127.0.0.1:9111 > > > > > > > > > Here 127.0.0.1 means literally Traefik localhost, not host machine localhost. Try docker0 interface IP, in most cases it is 172.17.0.1. If you don't want docker container port to be exposed directly to the internet, you can bind port using `- "172.17.0.1:9111:9000"` > > > > > > When I try 172.17.0.1 the error changes to Gateway timeout at least and doesn't just immediately fail at Bad gateway > > What is your docker0 ip? What ports do you see after running `docker ps`? docker0 ip : `172.17.0.1` docker ps ports: ``` [pangolin] : empty [traefik] : empty [gerbil] : 0.0.0.0:80->80/tcp, [::]:80->80/tcp, 0.0.0.0:443->443/tcp, [::]:443->443/tcp, 0.0.0.0:51820->51820/udp, [::]:51820->51820/udp [dummy stack] : 3000/tcp, 8080/tcp, 0.0.0.0:3201->3001/tcp, [::]:3201->3001/tcp ```
Author
Owner

@oloev commented on GitHub (May 11, 2025):

[dummy stack] : 3000/tcp, 8080/tcp, 0.0.0.0:3201->3001/tcp, [::]:3201->3001/tcp

Looks like only port 3201 is accessible from docker. Do you use it as target?
For test you can try to run python3 -m http.server --bind 172.17.0.1 on host and add target 172.17.0.1 with port 8000. Does it work?

<!-- gh-comment-id:2870242647 --> @oloev commented on GitHub (May 11, 2025): >[dummy stack] : 3000/tcp, 8080/tcp, 0.0.0.0:3201->3001/tcp, [::]:3201->3001/tcp Looks like only port 3201 is accessible from docker. Do you use it as target? For test you can try to run `python3 -m http.server --bind 172.17.0.1` on host and add target 172.17.0.1 with port 8000. Does it work?
Author
Owner

@ashleycameron commented on GitHub (May 11, 2025):

[dummy stack] : 3000/tcp, 8080/tcp, 0.0.0.0:3201->3001/tcp, [::]:3201->3001/tcp

Looks like only port 3201 is accessible from docker. Do you use it as target? For test you can try to run python3 -m http.server --bind 172.17.0.1 on host and add target 172.17.0.1 with port 8000. Does it work?

172.17.0.1 : 3201 is how i've setup my local resource target in pangolin yes.

Attempting the python server, same result of gateway timeout

<!-- gh-comment-id:2870244626 --> @ashleycameron commented on GitHub (May 11, 2025): > > [dummy stack] : 3000/tcp, 8080/tcp, 0.0.0.0:3201->3001/tcp, [::]:3201->3001/tcp > > Looks like only port 3201 is accessible from docker. Do you use it as target? For test you can try to run `python3 -m http.server --bind 172.17.0.1` on host and add target 172.17.0.1 with port 8000. Does it work? 172.17.0.1 : 3201 is how i've setup my local resource target in pangolin yes. Attempting the python server, same result of gateway timeout
Author
Owner

@pong106 commented on GitHub (May 12, 2025):

Got it working now. Here are the settings

I setup using local site and resource with 127.0.0.1:9111

Here 127.0.0.1 means literally Traefik localhost, not host machine localhost. Try docker0 interface IP, in most cases it is 172.17.0.1. If you don't want docker container port to be exposed directly to the internet, you can bind port using - "172.17.0.1:9111:9000"

In Pangolin add Resources with Targets Configuration's IP / Hostname set to container's IPv4 Address instead of localhost. The ip should be 172.X.X.X.

docker ps
docker inspect <container_name_or_id>

Then look for the NetworkSettings > Networks > IPAddress field.
or get ip from Portainer

<!-- gh-comment-id:2870815774 --> @pong106 commented on GitHub (May 12, 2025): Got it working now. Here are the settings > > I setup using local site and resource with 127.0.0.1:9111 > > Here 127.0.0.1 means literally Traefik localhost, not host machine localhost. Try docker0 interface IP, in most cases it is 172.17.0.1. If you don't want docker container port to be exposed directly to the internet, you can bind port using `- "172.17.0.1:9111:9000"` In Pangolin add `Resources` with `Targets Configuration`'s `IP / Hostname` set to container's IPv4 Address instead of localhost. The ip should be 172.X.X.X. ``` docker ps docker inspect <container_name_or_id> ``` Then look for the NetworkSettings > Networks > IPAddress field. or get ip from Portainer
Author
Owner

@pong106 commented on GitHub (May 12, 2025):

Also did managed to deploy uptime-kuma. Note the networks portions in yml. I believe that the service and Pangolin stack should share the same network and subnet. Port mapping is optional. Used http, 172.X.X.X and 3001 in Targets Configuration.

services:
  uptime-kuma:
    restart: always
    networks:
      - pangolin # note the networks here
    volumes:
      - /uptime:/app/data
    container_name: uptime-kuma
    image: louislam/uptime-kuma

# note the networks here
networks:
  pangolin:
    external: true
<!-- gh-comment-id:2872759716 --> @pong106 commented on GitHub (May 12, 2025): Also did managed to deploy uptime-kuma. Note the `networks` portions in yml. I believe that the service and `Pangolin` stack should share the same network and subnet. Port mapping is optional. Used `http`, `172.X.X.X` and `3001` in `Targets Configuration`. ``` services: uptime-kuma: restart: always networks: - pangolin # note the networks here volumes: - /uptime:/app/data container_name: uptime-kuma image: louislam/uptime-kuma # note the networks here networks: pangolin: external: true ```
Author
Owner

@ashleycameron commented on GitHub (May 12, 2025):

thanks for the help all, i also managed to resolve this. Was either / both needing to specify a custom network for gerbil and proxied services / waiting for dns to update and point to the right place

<!-- gh-comment-id:2873517067 --> @ashleycameron commented on GitHub (May 12, 2025): thanks for the help all, i also managed to resolve this. Was either / both needing to specify a custom network for gerbil and proxied services / waiting for dns to update and point to the right place
Author
Owner

@noahcub commented on GitHub (May 12, 2025):

Also did managed to deploy uptime-kuma. Note the networks portions in yml. I believe that the service and Pangolin stack should share the same network and subnet. Port mapping is optional. Used http, 172.X.X.X and 3001 in Targets Configuration.

services:
  uptime-kuma:
    restart: always
    networks:
      - pangolin # note the networks here
    volumes:
      - /uptime:/app/data
    container_name: uptime-kuma
    image: louislam/uptime-kuma

# note the networks here
networks:
  pangolin:
    external: true

It works for me. In target configuration I put the name of the container and works very well.

<!-- gh-comment-id:2873692683 --> @noahcub commented on GitHub (May 12, 2025): > Also did managed to deploy uptime-kuma. Note the `networks` portions in yml. I believe that the service and `Pangolin` stack should share the same network and subnet. Port mapping is optional. Used `http`, `172.X.X.X` and `3001` in `Targets Configuration`. > > ``` > services: > uptime-kuma: > restart: always > networks: > - pangolin # note the networks here > volumes: > - /uptime:/app/data > container_name: uptime-kuma > image: louislam/uptime-kuma > > # note the networks here > networks: > pangolin: > external: true > ``` It works for me. In target configuration I put the name of the container and works very well.
Author
Owner

@calim20 commented on GitHub (May 13, 2025):

Great many thanks! It works! :-)
Hopefully the services IP stays the same. 🤞

<!-- gh-comment-id:2876285171 --> @calim20 commented on GitHub (May 13, 2025): Great many thanks! It works! :-) Hopefully the services IP stays the same. 🤞
Author
Owner

@calim20 commented on GitHub (May 13, 2025):

Just checked, works also with container name instead of IP. 🎆

<!-- gh-comment-id:2876306978 --> @calim20 commented on GitHub (May 13, 2025): Just checked, works also with container name instead of IP. 🎆
Author
Owner

@gitandriu commented on GitHub (Nov 29, 2025):

How about local services installed natively (e.g., debian packages) and not through docker? Any way to refer to the host machine localhost?

<!-- gh-comment-id:3591784484 --> @gitandriu commented on GitHub (Nov 29, 2025): How about local services installed natively (e.g., debian packages) and not through docker? Any way to refer to the host machine localhost?
Author
Owner

@alanb2 commented on GitHub (Dec 5, 2025):

How about local services installed natively (e.g., debian packages) and not through docker? Any way to refer to the host machine localhost?

docker inspect pangolin find the "Gateway" address and create the resource in Pangolin with that IP

<!-- gh-comment-id:3617059349 --> @alanb2 commented on GitHub (Dec 5, 2025): > How about local services installed natively (e.g., debian packages) and not through docker? Any way to refer to the host machine localhost? `docker inspect pangolin` find the "Gateway" address and create the resource in Pangolin with that IP
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/pangolin#1549