[HELP] - Caddy proxy to VM on truenas

The problem I’m having:

Hi, I’m trying to use Caddy as a reverse proxy for a Home Assistant VM hosted on Truenas.

  • Caddy is installed as a Truenas application (docker)
  • Caddy is latest version: v2.10.0
  • Caddy is already acting as a reverse proxy to other applications (but not VMs) on the same Truenas machine.
  • The Home Assistant VM is accessible locally at http://192.168.1.35:8123.
  • When I attempt to connect via caddy on https://home.sebt.one I get an error 502 (Bad Gateway)

Error message on Caddy :

2025-08-15 16:17:12.466667+00:00{"level":"error","ts":1755274632.466511,"logger":"http.log.error","msg":"dial tcp 192.168.1.35:8123: connect: no route to host","request":{"remote_ip":"192.168.1.254","remote_port":"48290","client_ip":"192.168.1.254","proto":"HTTP/2.0","method":"GET","host":"home.sebt.one","uri":"/","headers":{"Sec-Fetch-Dest":["document"],"Sec-Fetch-Site":["none"],"Priority":["u=0, i"],"Sec-Fetch-User":["?1"],"User-Agent":["Mozilla/5.0 (X11; Linux x86_64; rv:141.0) Gecko/20100101 Firefox/141.0"],"Sec-Fetch-Mode":["navigate"],"Accept-Language":["en-US,en;q=0.5"],"Accept-Encoding":["gzip, deflate, br, zstd"],"Sec-Gpc":["1"],"Upgrade-Insecure-Requests":["1"],"Te":["trailers"],"Accept":["text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"]},"tls":{"resumed":true,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"home.sebt.one"}},"duration":1.254436976,"status":502,"err_id":"rbrdc0ca8","err_trace":"reverseproxy.statusError (reverseproxy.go:1390)"}

Truenas version:

25.04.2.1

Caddy details

Compose

services:
  caddy:
    image: caddy:latest
    restart: unless-stopped
    environment:
      - PUID=568
      - PGID=568
      - TZ=Europe/Paris
    cap_add:
      - NET_ADMIN
    ports:
      - "80:80"
      - "443:443"
      - "443:443/udp"
    volumes:
      - /mnt/SSD-Mirror/services/caddy/data:/data
      - /mnt/SSD-Mirror/services/caddy/Caddyfile:/etc/caddy/Caddyfile
      - /home/truenas_admin/websites/:/websites

Relevant Caddy config:

home.sebt.one {
        reverse_proxy 192.168.1.35:8123
}

(obviously there are other lines for the other services but this is the only part that’s relevant)

Additional Info

I have tried adding a bridge (as I have seen this being mentioned on other similar threads) but this operation fails when I attempt it.

If you need any additional information from me please ask.

Thank you for any help. :bowing_man:

No bridge = no communication from the Host to VM’s, read this if you want to understand why → Accessing NAS from a VM or Apps | TrueNAS Documentation Hub.

I’ll edit with the proper instructions if I find them again, edit here you go

I’ll be honest, these instructions are very unclear to me.

The guide just tells you at one point to simply “add a bridge interface” but it’s just a generic page that doesn’t helpe me navigate replacing my current networking setup to go through the new bridge.

I’ll explain what I did and I’m sure you’ll be able to tell me what I did that was wrong.
Initial setup:

  • removed DHCP from my initial interface
  • deactivated “autoconfigure IPV6”
  • made sure there were no aliases
  • created a new interface of “bridge” type
  • named it br0
  • added my initial interface (enp7s0) to the bridge
  • added aliases with the IPs that were previously configured to my initial interface
    Overview of bridge configuration:

I obtain the following result:

This does not pass the 60 second network test…

Try inside the Console if it doesn’t work with the GUI, either way you need a Bridge interface for VM ↔ App communication, and sometimes the console is easier to work with

I don’t have an answer to this, but I was experiencing the same thing under both 24.10 and 25.04–Docker apps wouldn’t/couldn’t communicate with the VM on the machine (but that VM could reach and mount NFS storage on the NAS). I was using br0 for the apps, the VM, and the NAS itself.

OK I was doing the configuration fine.
The network test was not working because I had not turned all apps and the VM off before starting tests.

It works now \o/