Migrate from Zoraxy to Caddy

Here’s a step-by-step guide to migrate from Zoraxy to Caddy as your reverse proxy, including HTTPS and domain-based routing.


🧭 Assumptions


βœ… Step-by-Step Migration from Zoraxy to Caddy


πŸ” 1. Stop and Disable Zoraxy
sudo systemctl stop zoraxy
sudo systemctl disable zoraxy

If running via Docker:

docker stop zoraxy
docker rm zoraxy

πŸ“¦ 2. Install Caddy

🟒 Option 1: Install via Package (Recommended)

sudo apt update
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curl
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo tee /etc/apt/trusted.gpg.d/caddy.gpg > /dev/null
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy.list
sudo apt update
sudo apt install caddy

Caddy runs as a service and listens on ports 80 and 443 by default.


🧾 3. Create Your Caddyfile
sudo nano /etc/caddy/Caddyfile

Example:

# Authelia login portal
auth.greenhome.stream {
    reverse_proxy 172.17.1.38:9091
}

# App behind Authelia
app1.greenhome.stream {
    reverse_proxy 172.17.1.40:3000

    route {
        forward_auth auth.greenhome.stream {
            uri /api/verify?rd=https://auth.greenhome.stream
            copy_headers Remote-User Remote-Groups Remote-Name Remote-Email
        }

        reverse_proxy 172.17.1.40:3000
    }
}
πŸ“Œ Notes:

πŸ” 4. Reload Caddy to Apply Config
sudo caddy reload

If there's a syntax error:

sudo caddy validate

πŸ” 5. Ensure HTTPS Works (Auto Let's Encrypt)

Caddy will automatically:

Check certs:

sudo caddy list-certs

🚦 6. Set DNS Records (If Not Already)

Make sure these A records are set:

Subdomain Value
auth.greenhome.stream your_public_ip
app1.greenhome.stream your_public_ip

πŸ§ͺ 7. Test the Setup

🧹 8. Optional: Remove Zoraxy Completely

If everything works:

sudo rm -rf /etc/zoraxy /var/lib/zoraxy

πŸ” Add More Apps?

Just extend your Caddyfile:

nextcloud.greenhome.stream {
    reverse_proxy 172.17.1.42:8080

    route {
        forward_auth auth.greenhome.stream {
            uri /api/verify?rd=https://auth.greenhome.stream
        }

        reverse_proxy 172.17.1.42:8080
    }
}

βœ… You're Done!

Caddy now:


Ins0mniA


Revision #2
Created 2025-08-22 03:45:18 EEST by Green
Updated 2025-09-04 02:04:41 EEST by Green