Shield external portal jumps (keep EXTERNAL_* for later), serve /nav from static build, and proxy /book + /community to vertical Next apps with Caddy notes. Co-authored-by: Cursor <cursoragent@cursor.com>
45 lines
1.2 KiB
Caddyfile
45 lines
1.2 KiB
Caddyfile
# nomadro.cn / www.nomadro.cn — portal + path apps
|
|
# Paste into main Caddyfile or import this snippet.
|
|
# Assumes systemd (or similar) listeners:
|
|
# portal :3000
|
|
# navmini static OR :5173 (prefer static under /var/www/nomadro/nav)
|
|
# ebook :3001 (Next basePath=/book)
|
|
# nomadweb :3002 (Next basePath=/community)
|
|
# nomadweb API :8000 (optional separate handle)
|
|
|
|
nomadro.cn, www.nomadro.cn {
|
|
encode gzip zstd
|
|
|
|
# --- vertical apps (same-origin sub-pages) ---
|
|
handle /nav/* {
|
|
# Prefer prebuilt static (pnpm build:nav → public/nav)
|
|
root * /var/www/nomadro/portal
|
|
try_files {path} /nav/index.html
|
|
file_server
|
|
}
|
|
|
|
handle /book* {
|
|
reverse_proxy 127.0.0.1:3001
|
|
}
|
|
|
|
handle /community* {
|
|
reverse_proxy 127.0.0.1:3002
|
|
}
|
|
|
|
# Optional: community API if not already on api.nomadro.cn
|
|
# handle /community/api* {
|
|
# uri strip_prefix /community
|
|
# reverse_proxy 127.0.0.1:8000
|
|
# }
|
|
|
|
# --- portal home ---
|
|
handle {
|
|
reverse_proxy 127.0.0.1:3000
|
|
}
|
|
}
|
|
|
|
# Existing product hostnames can keep pointing at the same upstreams, e.g.:
|
|
# nav.nomadro.cn → static nav or :5173
|
|
# ebook.nomadro.cn → :3001 (may omit basePath on dedicated host — see apps/README)
|
|
# Existing nomadweb host → :3002
|