I am having some issues and I hope I can get some help. Initially I was trying to run a Nextcloud container through my Cloudflare Tunne, but I kept getting a 502 Bad Gateway error, I read online it's because Cloudflare cannot communicate with the container and they recommended to install a proxy manager, so I am now trying to set up an Nginx Proxy Manager docker instance, but instead of opening the ports on my Firewall, I want to get to it through my Cloudflare Tunnel.
I am able to spin up the Nxinx instance but when I try to set the domain name to redirect to nginx, I am not able to reach it, so I found on Reddit that you need to add this to the cloudflared config.yml.
ingress:
- hostname: xxx.yourdomain.com
service: https://192.168.1.x:443 #npm
originRequest:
noTLSVerify: true
I have two issues here, one, I can't find where the config file is natively, and second, when I try to run the container with a --config command or with compose, I get the error that cloudflared can't open the file or folder.
I have tried this command:
docker run -d cloudflare/cloudflared:latest tunnel --config /home/"username"/cloudflared/config.yml --name cloudflared --no-autoupdate run --token "my token"
And I've tried this docker-compose:
version: "3.8"
services:
cloudflared:
image: cloudflare/cloudflared:latest
container_name: cloudflared
restart: unless-stopped
command: tunnel --config ./config.yml --no-autoupdate run
environment:
- TUNNEL_TOKEN="my token"
volumes:
- ./data:/home/nonroot/.cloudflared/
Any help would be appreciated it, what I am trying to do in the end is: www.domain.com > hits Cloudflare > sends it to my Nginx through the Tunnel > Nginx sends it to the right container.
And also, does anyone know if I can use Nginx for 3 different Docker hosts, or do I need to do one for each Server VM?
Thank you everyone for your help!