konduktor/config.yaml
Илья Глазунов 83cb7d68b0 initial commit
2025-09-01 23:49:50 +03:00

62 lines
1.6 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

http:
static_dir: ./static
templates_dir: ./templates
server:
host: 0.0.0.0
port: 8080
backlog: 5
default_root: false
redirect_instructions:
- "/docs": "/docs.html"
ssl:
enabled: false
cert_file: ./ssl/cert.pem
key_file: ./ssl/key.pem
logging:
level: DEBUG
console_output: true
log_file: ./logs/pyserve.log
# НОВОЕ: Расширяемые модули
extensions:
# Встроенное расширение для продвинутой маршрутизации
- type: routing
config:
regex_locations:
# API маршруты с захватом версии
"~^/api/v(?P<version>\\d+)/":
proxy_pass: "http://localhost:9001"
headers:
- "API-Version: {version}"
- "X-Forwarded-For: $remote_addr"
# Статические файлы с долгим кэшем
"~*\\.(js|css|png|jpg|gif|ico|svg|woff2?)$":
root: "./static"
cache_control: "public, max-age=31536000"
headers:
- "Access-Control-Allow-Origin: *"
# Exact match для health check
"=/health":
return: "200 OK"
content_type: "text/plain"
"=/":
root: "./static"
index_file: "index.html"
# SPA fallback для всех остальных маршрутов
"__default__":
spa_fallback: true
root: "./static"
index_file: "docs.html"
# Исключения для SPA (не попадают в fallback)
exclude_patterns:
- "/api/"
- "/admin/"
- "/assets/"