43 lines
927 B
Caddyfile
43 lines
927 B
Caddyfile
# Caddy config.
|
|
#
|
|
# Two site blocks:
|
|
# 1. :80 — handles all HTTP traffic by IP (no domain yet) for development access.
|
|
# Returns plain HTTP, no TLS. Will be removed once a domain is bought.
|
|
# 2. gendesign.example.ru — production block with auto-TLS via Let's Encrypt.
|
|
# Activates only after DNS A-record is set on this domain.
|
|
#
|
|
# Replace gendesign.example.ru with your actual domain when bought.
|
|
|
|
:80 {
|
|
encode zstd gzip
|
|
|
|
# Backend API
|
|
handle_path /api/* {
|
|
reverse_proxy backend:8000
|
|
}
|
|
|
|
handle /health {
|
|
reverse_proxy backend:8000
|
|
}
|
|
|
|
# Frontend (Next.js) — catches everything else
|
|
handle {
|
|
reverse_proxy frontend:3000
|
|
}
|
|
}
|
|
|
|
gendesign.example.ru {
|
|
encode zstd gzip
|
|
|
|
handle_path /api/* {
|
|
reverse_proxy backend:8000
|
|
}
|
|
|
|
handle /health {
|
|
reverse_proxy backend:8000
|
|
}
|
|
|
|
handle {
|
|
reverse_proxy frontend:3000
|
|
}
|
|
}
|