Qortora · Search · Indexed page

caddy.communityFetched 2026-08-17T13:10:47Z

Unable to redirect to truenas homepage - Help - Caddy Community

1. The problem I’m having: I am trying to make it so my local network can resolve the following: http://{$MY_DOMAIN}.club to http://{$SERVER_IP}.club:82 https://{$MY_DOMAIN}.club to https://{$SERVER_IP}.club:8443 The…

Open original source · Full cached text

Unable to redirect to truenas homepage - Help - Caddy Community = 40rem)" rel="stylesheet" data-target="chat_desktop" /> = 40rem)" rel="stylesheet" data-target="discourse-reactions_desktop" /> = 40rem)" rel="stylesheet" data-target="poll_desktop" /> = 40rem)" rel="stylesheet" data-target="desktop_theme" data-theme-id="1" data-theme-name="caddy custom"/> Unable to redirect to truenas homepage Help Corun (Corun) August 9, 2026, 9:58am 1 1. The problem I’m having: I am trying to make it so my local network can resolve the following: http://{$MY_DOMAIN}.club to http://{$SERVER_IP}.club:82 https://{$MY_DOMAIN}.club to https://{$SERVER_IP}.club:8443 The server is a truenas system, with the port for http changed to 82, and https to 8443 (so that caddy would work, as it takes control over those ports). Problem is, the server hostname is “truenas”, which I do not want to change as other internal apps are set to use it, and I do not want them to use a full domain with tld incase they reach outside of my network should caddy go down or my gateway lost its DNS A-Records. Currently: https://MY_DOMAIN.club/ > redirects to IP https://MY_DOMAIN.club/ui/signin > goes through fine no issues HTTPS is working via DNS=01 challenge on the domain with .club TLD when it doesn’t redirect to IP. I have a domain registered pointing to local IP of the server. Domain with .com tld uses self-signed cert, not that this matters for the issue. 2. Error messages and/or full log output: PASTE OVER THIS HERE IN THIS CODE BLOCK. Please ensure it looks nice. 3. Caddy version: v2.11.4 4. How I installed and ran Caddy: Built with porkbun with custom dockerfile. Dockerfile: FROM caddy:2-builder AS builder RUN xcaddy build \ --with github.com/caddy-dns/porkbun FROM caddy:2 COPY --from=builder /usr/bin/caddy /usr/bin/caddy a. System environment: Truenas 25.04 Docker b. Command: PASTE OVER THIS HERE IN THIS CODE BLOCK. Please ensure it looks nice. c. Service/unit/compose file: services: caddy: build: . container_name: caddy restart: unless-stopped ports: - 80:80 - 443:443 - 443:443/udp volumes: - /mnt/apps/configs/caddy:/etc/caddy - /mnt/apps/data/caddy:/data env_file: - .env environment: #Set variables to the .env value so caddyfile can use variable syntax that works in all fields - TZ=Australia/Adelaide - PORKBUN_API_KEY=${PORKBUN_API_KEY} - PORKBUN_API_SECRET_KEY=${PORKBUN_API_SECRET_KEY} - MY_DOMAIN=${MY_DOMAIN} - SERVER_IP=${SERVER_IP} networks: {} d. My complete Caddy config: # Global configuration block - sets up Porkbun for DNS challenges { acme_dns porkbun { api_key {$PORKBUN_API_KEY} api_secret_key {$PORKBUN_API_SECRET_KEY} } } vpn.{$MY_DOMAIN}.club { reverse_proxy https://{$SERVER_IP}:51820 } jellyfin.{$MY_DOMAIN}.club { reverse_proxy https://{$SERVER_IP}:3020 } seerr.{$MY_DOMAIN}.club { reverse_proxy https://{$SERVER_IP}:5055 } # Internal domain HTTP proxies to TrueNAS HTTP (port 82) {$MY_DOMAIN}.com:80 { reverse_proxy http://{$SERVER_IP}:82 } # Public domain HTTP proxies to TrueNAS HTTP (port 82) {$MY_DOMAIN}.club:80 { reverse_proxy http://{$SERVER_IP}:82 } # Public domain HTTPS proxies to TrueNAS HTTPS (port 8443) {$MY_DOMAIN}.club:443 { reverse_proxy https://{$SERVER_IP}:8443 { transport http { tls_insecure_skip_verify } } } # Internal domain HTTPS proxies to TrueNAS HTTPS (port 8443) with internal cert {$MY_DOMAIN}.com:443 { tls internal reverse_proxy https://{$SERVER_IP}:8443 { transport http { tls_insecure_skip_verify } } } I also use this for the .env file: PORKBUN_API_KEY=REDACTED PORKBUN_API_SECRET_KEY=REDACTED MY_DOMAIN=vault SERVER_IP=10.33.2.155 faiyaz032 (Faiyaz Rahman) August 11, 2026, 7:13pm 2 That redirect is not caddy, nothing in your config redirects anywhere. Its TrueNAS building an absolute redirect from its own address, so / bounces to the IP. /ui/signin works because it’s a real path and doesn’t trigger the redirect. Quick check: curl -sI https://vault.club/ and look at the Location: line. You can try two ways to fix it: either disable TrueNAS’s own HTTP→HTTPS redirect in its GUI settings (Caddy handles TLS), or have caddy rewrite the redirect’s location header so it points back at your domain instead of the IP. Also heads up, your log/command blocks still say “PASTE OVER THIS HERE”, and your vpn block proxies to :51820 which is WireGuard’s UDP port, so that one won’t work.