#atom

Subtitle:

Automated HTTPS and reverse proxy setup for AI service endpoints


Core Idea:

Caddy Server provides automatic HTTPS certificate management and reverse proxy capabilities to secure AI services and make them accessible through clean, subdomain-based URLs.


Key Principles:

  1. Automatic TLS/SSL:
    • Caddy obtains and renews Let's Encrypt certificates without manual intervention.
  2. Reverse Proxy Routing:
    • Maps external subdomains to internal services running on specific ports.
  3. Configuration Simplicity:
    • Uses a declarative configuration approach with minimal syntax for complex setups.

Why It Matters:


How to Implement:

  1. Install Caddy in Docker Compose:
 caddy:
  image: caddy:2
  restart: unless-stopped
  ports:
    - "80:80"
    - "443:443"
  volumes:
    - ./Caddyfile:/etc/caddy/Caddyfile
    - caddy_data:/data
    - caddy_config:/config
  1. Configure Basic Caddyfile:
n8n.yourdomain.com {
  reverse_proxy n8n:5678
  tls your-email@example.com
}

supabase.yourdomain.com {
  reverse_proxy supabase:3000
  tls your-email@example.com
}
  1. Set Environment Variables:
CADDY_N8N_HOSTNAME=n8n.yourdomain.com
CADDY_SUPABASE_HOSTNAME=supabase.yourdomain.com
CADDY_OPENWEBUI_HOSTNAME=openwebui.yourdomain.com
CADDY_EMAIL=your-email@example.com

Example:

{
  email your-email@example.com
}

n8n.yourdomain.com {
  reverse_proxy n8n:5678
}

supabase.yourdomain.com {
  reverse_proxy supabase:3000
}

openwebui.yourdomain.com {
  reverse_proxy openwebui:3000
}

flowise.yourdomain.com {
  reverse_proxy flowise:3000
}

Connections:


References:

  1. Primary Source:
    • Caddy Server Official Documentation
  2. Additional Resources:
    • Local AI Package Caddy Configuration Guide
    • Let's Encrypt Documentation

Tags:

#caddy #https #reverse-proxy #tls #security #subdomains #infrastructure


Connections:


Sources: