I'm trying to set up my Vaultwarden on a UGREEN NAS (DXP4800) and access it securely using a Cloudflare tunnel, but I'm running into a 502 error. My goal is to connect remotely to my vault without exposing my local network. Currently, I'm using Docker Compose for my setup with services for Vaultwarden and nginx. Here's a snippet of my Docker Compose configuration, and I've included essential details like the internal IPs. I'm not using Portainer. I have a Cloudflare tunnel configured but I think I may be using incorrect IPs or settings. I appreciate any help to get this working!
1 Answer
Instead of using direct IPs for your Docker containers in the Cloudflare tunnel, use the service names. For example, you could specify `http://vaultwarden:80` in your tunnel configuration. The issue could also stem from having separate Docker networks that prevent communication between the cloudflared container and the Vaultwarden container. Make sure they're in the same network and let me know how it goes.

I've tried multiple configurations, including direct IPs like `https://192.168.1.41:8443`, but they didn't work either. What would be the best way to set up the certificates for Cloudflare?