Files
platform/Caddyfile
Vladimir Zagainov 9433a2e655
Some checks failed
continuous-integration/drone/push Build was killed
fix: restructure Caddyfile with proper directive ordering using matchers
2026-01-16 16:54:05 +03:00

34 lines
983 B
Caddyfile

# Основной блок для вашего домена
{$APP_DOMAIN} {
# Включаем сжатие для ускорения загрузки
encode zstd gzip
# --- Заголовки безопасности ---
header {
X-Frame-Options "SAMEORIGIN"
X-Content-Type-Options "nosniff"
Strict-Transport-Security "max-age=31536000;"
}
# --- Маршрутизация запросов ---
# 1. API бэкенда (Yggdrasil, Web, Admin)
@api path /api/* /authserver/* /sessionserver/*
reverse_proxy @api backend:8080
# 2. WebSocket для измерения пинга
@ws path /ws/ping
reverse_proxy @ws ping-helper:8081
# 3. Раздача файлов (скины, модпаки)
handle_path /files/* {
root * /srv
file_server
}
# 4. Фронтенд (Vue.js SPA) - все остальные запросы
handle {
reverse_proxy frontend:80
}
}