mirror of
https://github.com/fosrl/pangolin.git
synced 2026-05-08 13:49:15 -05:00
Bad gateway errors after adding resources in Pangolin #494
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @SprMario on GitHub (Jul 16, 2025).
Hello everyone.
Today I tried adding a local resource to my Pangolin install (the first one) but I am receiving Bad Gateway errors. I installed the deployment using the official install script.
Edge server:
Newt logs (seems fine):
Remote server:
Pangolin logs (no Docker socket access):
Pangolin dashboard settings (site name changed for privacy):
DNS record pointing to VPS correctly.
Can anyone advise me on what to check, I am bit lost to be honest.
@oschwartz10612 commented on GitHub (Jul 16, 2025):
Bad gateway is typically Newt not being able to reach the target service. What target do you have programmed into the resource and are you sure newt can see it on your network?
@SprMario commented on GitHub (Jul 16, 2025):
To give you a bit more context. Pangolin on VPS with a resource made to target a dashboard on the home server. In this case I use portainer as an example. The target is a docker image(portainer) running on the home server. So newt and the target are in the same VM:

Newt itself doesn't show any meaningful logs:
@MorganKryze commented on GitHub (Jul 22, 2025):
Hi @SprMario
I did a working setup (not sure that this would be the right way to do it but still), between a VPS and a home server. On the server side I set up a Newt container as such:
And here is my config for a service (e.g. Filebrowser, but could be Portainer if you like):
To sum up:
pangolin(feel free to change the name if desired)pangolinexposeinstead ofportsto map the ports (exposeis purely indicative and does not change the behavior of the container, but add clarity to your config)pangolinNow that this is running, on the pangolin dashboard, when creating a new resource, we can use docker name resolving capabilities and target our
filebrowserservice ashttp://filebrowser:80and this will target thefilebrowsercontainer on port80without any issue as they are on the same network.Here is the view on the dashboard:
Care to save your changes!
I am no maintainer or expert, but feel free to ask if I may help in this case or if you need more detail on this
@SprMario commented on GitHub (Jul 24, 2025):
Thanks for the guide. I set this up using the install script. I will retry during the weekend to see where the issue is.
@MorganKryze commented on GitHub (Jul 24, 2025):
Would you share the content of your
newtandportainercontainers? The issue may be in their configs. A screenshot of your proxy tab from pangolin would also help us find the root of the issue.@SprMario commented on GitHub (Jul 27, 2025):
Hi Morgan,
The pangolin screenshot of the proxy page is:
Not sure how you want me to share the content of the containers. They are made using docker, not compose.
@MorganKryze commented on GitHub (Jul 27, 2025):
Hi @SprMario,
Thanks, can you send me the
docker runcommands used to start theportainerandnewtcontainer (care to obfuscate the credentials if there is some). Or config page inside Portainer if so, I do not particularly know portainer and its network management.My intent here is to see what is the network configuration of your containers. My suggestion would be to create a
pangolinornewt(whatever you may want to call it) network and put your containers onto it so that they can communicate between each other flawlessly. Plus that brings a feature letting us call service by internal DNS addresses like :http://filebrowser:80orhttp://portainer:9000.Note: if you intend to expose your Portainer service, please make sure to limit access to the domain with the
Authenticationtab.@SprMario commented on GitHub (Jul 27, 2025):
Hi @MorganKryze ,
Here is Portainer:
docker run -d -p 9000:9000 -p 9443:9443 --name portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:ltsFor newt I used the automatic install script of pangolin, I dont really know how that was executed. I can inspect the image if you want?
@MorganKryze commented on GitHub (Jul 27, 2025):
First, my guess would be to uninstall newt from your machine as you used the script as it will not be convenient to update its configuration over the time.
If you want to stay with
docker runcommands, here would be the updated commands to run:docker network create --driver bridge pangolin: create the pangolin networkdocker run -d -p 9000:9000 -p 9443:9443 --name portainer --restart unless-stopped -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data --network pangolin portainer/portainer-ce:lts: run portainer in the new network (note that you may remove the-p 9443:9443if you intend to only use pangolin as a reverse proxy targeting port 9000)Finally, for newt, care to replace the variables to your own:
Later, once you see that your site is online on the site tab, go to the resources tab and replace the ip address
192.168.178.110of your machine byportaineras I have shown in my first pangolin capture.Hopefully, that should resolve your issue
@MorganKryze commented on GitHub (Aug 3, 2025):
Hey @SprMario,
Could you get your service to work?
@SprMario commented on GitHub (Aug 4, 2025):
No I didn't. I am going to abandon getting this to work.
@MorganKryze commented on GitHub (Aug 6, 2025):
Sorry to hear that, would you describe the issue you are facing, provide some logs, context?
@SprMario commented on GitHub (Aug 6, 2025):
The issue is in the first post. I get bad gateway errors. I did not rebuild everything as you suggested in your response, I re-ran the install script from Pangolin and restarted all the services. Didnt work > uninstall.
@Lokowitz commented on GitHub (Aug 6, 2025):
Hi @SprMario
Portainer UI is listening on https and port 9443.
So if you want to access the Portainer Ui you have to change it in your pangolin target, currently i see http and port 9000 in your post.
Portainer documentation
@SprMario commented on GitHub (Aug 6, 2025):
You're right. I tried both ports as portainer listens to 9000 for http and adjusted to 9443 for https, bad gateway when I tried.
@Lokowitz commented on GitHub (Aug 6, 2025):
Just tried it with my server and it is working.
So could you please double check:
ip ato check)Did you tried to reach other sites or services or is portainer the only one?
@oschwartz10612 commented on GitHub (Aug 6, 2025):
^^^ this is all good to check. I do suspect usually bad gateway comes
means you are at least getting to pangolin and through traefik.
Double check the IP info and that its reachable from where newt is
installed. You could do a curl command to test!
Also this has tripped me up a couple of times and its super stupid haha:
Make sure you have the resource on the right site!
You can see the newt logs and if it cant make it to portainer you should
see some errors.
@mvkotowski commented on GitHub (Aug 6, 2025):
I am experiencing sporadic Bad Gateway error messages whenever I try to add a new stack to portainer, but can access it through legacy 9000 port. I will report back on what my logs are saying and implementing your guide for network. Guacamole is also kicking me out. I initially thought it was Home Assistant getting paired with Pangolin, but after I removed it, the errors persisted. It was not this bad at initial install.
Edit 3: ports are opened:
Edit 4: Tinyfiles gives the same bad gateway error, but refreshing page gets me back in.
Edit 5: Still experiencing the gateway issues even after using your format
Edit 6: The only container doing anything interesting is the newt container and the gerbil container. It reconnects every minute after the following error from newt. Gerbil is simply adding and removing the same peer successfully.
Edit 7: Got it Fixed!!
@SprMario commented on GitHub (Aug 8, 2025):
Currently I only had portainer installed as a test, I will try bitwarden as an example next.
@SprMario commented on GitHub (Aug 8, 2025):
I remade the configuration and these suggestions are checked.
I am going to use Vaultwarden as example with the newt configuration from @MorganKryze
@SprMario commented on GitHub (Aug 8, 2025):
Hi all,
Today I REMADE the Pangolin installation using this install script:
https://docs.digpangolin.com/self-host/quick-install
Everything went well on the VPS:
Install newt on edge server and check logs:
Try to reach Pangolin site.
This includes reaching Pangolin from external network(connecing from work):
Install Vaultwarden on port 8080:
Docker compose for BW using port 8080, expose didn't do anything:
Seems good 💃
Resources added in Pangolin:
Let's check the result:
I decided to do this again so that it might help someone else in the future but I deployed Tailscale within an hour. Troubleshoot this has been a hell.
@mvkotowski here is the link you made a screenshot of:
https://github.com/fosrl/pangolin/issues/1070#issuecomment-3105131178
@MorganKryze commented on GitHub (Aug 8, 2025):
Thanks for all the efforts @SprMario !!
But before closing this issue, I described using docker DNS: as you newt and your vaultwarden are on the same subnetwork
pangolin, you will need to use the address:vaultwarden80on the Pangolin dashboard !You used:
Instead of:
portswill route the port outside the subnetwork to the docker host. That is why you can access is usinghttp://your-ip:8080which you should not be able to.exposewill tell docker on which port the container runs, but will not get anything out of it, we want the container to be accessed by newt, not on your local network, so an SSL cert can be applied to your connection for instance.So:
portsblock toexposeas shown earlier;vaultwarden(the container_name) and port80(where vaultwarden is exposing inside its container).That should solve your issue!
Let me know if that helped, but we are clooose
@mvkotowski commented on GitHub (Aug 8, 2025):
@SprMario Sorry for being lazy. You're right and thank you for linking the screenshot link. I had hoped that changing the nomenclature to use the container names to link to proxy would have solved the bad gateway issue. So far only compose down and up seem to calm down the issue for a little while.
@miloschwartz I can confirm that the issue persists and have done the Cloudflare DNS check and port check, and am willing to help continue to troubleshoot this. I reflashed the vps yesterday and updated traefik to 3.5 and the issue seems less prevalent but still there. Maybe it's something to do with my setup at the site level? There are some things that I am not well versed enough in yet. What else can I provide to help?
@MorganKryze commented on GitHub (Aug 8, 2025):
@mvkotowski Would you share sample of the stacks you are trying to deploy?
My guess is that you are also bridging the ports outside the docker subnetwork, thus making them available on your local network which cannot be routed through newt. My setup isolates the services to be routed only by newt to avoid local http connections and substitute ip addresses as target to container names which is more friendly on ip change (even if you change network configuration on the
pangolinsubnetwork).If you want your services to be accessible on your local network using http, you may need to change my configuration though.
Will be happy to help with the necessary data to debug
@mvkotowski commented on GitHub (Aug 8, 2025):
@MorganKryze
One thing that I had a question about.. I didn't change the defaults for the subnet or the IP Address of the site. Does that need to be changed and to what? I'm not entirely sure which IP address it's asking for. Is it asking for the IP address of the device on my local network?
@MorganKryze commented on GitHub (Aug 8, 2025):
So, with this configuration and a target proxy on the pangolin dashboard set to:
httpsportainer9443you are having a bad gateway? Are your certs valid?I would not recommend changing the address ip of the site. It is a generated ip address for your site itself to route traffic correctly. On this topic I am no expert though. I am having a correct setup with multiple working sites, and did not change these addresses once.
@SprMario commented on GitHub (Aug 8, 2025):
@MorganKryze I am sending a virtual beer to your location. This works however I cant make sense why because of my bad routing skills. To me approaching something within the network from the same network should not be unapproachable. I am going to dive into docker networking a little more.
I would like to understand if my thought process was off, is there anything I should be thinking differently about?
End result:
And the resources:
@mvkotowski commented on GitHub (Aug 8, 2025):
No wonder it was upset. I had routed portainer to
httpportainer9000because of the http error it gives when you leave it default.Sorry for the question, but how do I check my certs?
Thank you so much for your help again! I am also running close to 70 services as well and it works, the bad gateway messages are sporadic and only on certain requests.
@MorganKryze commented on GitHub (Aug 8, 2025):
I'm so glad that you could both make it work!
I'll be coming back on this with hand-crafted diagram.
Happy tinkering homelabbing fella!
@MorganKryze commented on GitHub (Aug 9, 2025):
Just to be clear, I am not expert, and may not give you the best explanation out there, I definitely recommend you to check pro videos like these:
The following diagrams show both approaches that you can adopt. To be consistent with my first message, we will try to route a
filebrowsercontainer, but you can replace it with whatever service you may want.First, we run the containers without subnets on your local network. To be accessible to your laptop and your
newtcontainer, yourfilebrowserneeds to be accessible to your local network and so, you expose the port80outside the container and port it to your server:If the local IP of our server is
192.168.1.11, then we should route the service in the pangolin dashboard tohttp192.168.1.1180. If your laptop is connected on the same network, you should be able to connect to http://192.168.1.11:80.Alternatively, we create a
pangolinnetwork, a subnet inside our server. We attach ourfilebrowserandnewtcontainer to this network to allow them to interact with each other, but preventing devices from your local network to access them. This was to me a security measure that I wanted to set up to force users that want to access my service to go through my domain andhttpsconnections. As both our containers are on the same network, we do not need the directiveports:in thecompose.ymlfile.But, what we require is to know
filebrowserIP address inside the subnetwork. To facilitate this step, we use a stable resolving method using thecontainer_name:directive to define a custom hostname. This way, containers in your subnetwork would be able to resolve your service IP using their container name:newtcan accessfilbrowserathttp://filebrowser:80. Theexpose:directive is optional as this directive has no effect on the container behavior but let the user know what is going on.So, you would do the same on the pangolin dashboard and route traffic to:
httpfilebrowser80. In case that your service is creating self-signed certificates, choosehttps, pangolin will not override those and be able to route traffic correctly. I said earlier to check if they are valid, what I meant was trying in local to connect to your service and see if your browser indicates that the certificates are flagged as "self-signed" which they regularly warn you about, or if they happen to flag them as "invalid". I would not be able to elaborate, this is rather empiric observations.Let me know if any of these have helped you,
Cheers
@SprMario commented on GitHub (Aug 12, 2025):
@MorganKryze thank you for the explanation. How I understand it now is that you expose the networks "ports" but use the docker DNS to route to the right service. I add the pangolin network to each container I want to reach from the internet, is that right?
networks: pangolin: name: pangolin external: true@MorganKryze commented on GitHub (Aug 12, 2025):
Yup! That's it!
Furthermore, if you have a stack, let's say a webserver + database: you would create a internal network "my-stack-network" where both containers would communicate, and connect only the webserver to the "pangolin" network to route the webserver to the internet. The database would remain private which is pretty much what we want in general.