Spaces:
Running
Running
Download config/Caddyfile.example from amangs/cbot: direct link, hf CLI and curl.
- Browser
- Download file 1.68 kB
-
https://huggingface.co/spaces/amangs/cbot/resolve/main/config/Caddyfile.example
- Command line
-
hf download hf://spaces/amangs/cbot/config/Caddyfile.example
-
curl -L -o Caddyfile.example https://huggingface.co/spaces/amangs/cbot/resolve/main/config/Caddyfile.example
1.68 kB
| :7860 { | |
| # 1. REA MCP Server (Strict Token Authentication via Caddy) | |
| @mcp_auth { | |
| path /mcp* | |
| header Authorization "Bearer @man.g" | |
| header X-API-Key "@man.g" | |
| } | |
| handle /mcp* { | |
| @not_authed { | |
| not header Authorization "Bearer @man.g" | |
| not header X-API-Key "@man.g" | |
| } | |
| respond @not_authed "{\"jsonrpc\":\"2.0\",\"error\":{\"code\":-32000,\"message\":\"Unauthorized: Bearer token or X-API-Key required.\"},\"id\":null}" 401 | |
| reverse_proxy 127.0.0.1:8093 { | |
| flush_interval -1 | |
| } | |
| } | |
| handle /healthz { | |
| reverse_proxy 127.0.0.1:8093 | |
| } | |
| # 2. code-server routing (/code) | |
| @code_noslash path /code | |
| redir @code_noslash /code/ 308 | |
| handle_path /code/* { | |
| reverse_proxy 127.0.0.1:8443 | |
| } | |
| # 3. goFiles file manager (/files -> mounted at /data) | |
| @files_noslash path /files | |
| redir @files_noslash /files/ 308 | |
| handle_path /files/* { | |
| reverse_proxy 127.0.0.1:8100 { | |
| header_up X-Forwarded-Prefix /files | |
| } | |
| } | |
| # 4. opencode-router (/opencode/* -> 127.0.0.1:8787) | |
| # Strip prefix so everything under /opencode/ (index.html, assets, /api, /v1) | |
| # routes strictly through /opencode without polluting the root domain. | |
| @opencode_noslash path /opencode | |
| redir @opencode_noslash /opencode/ 308 | |
| handle_path /opencode/* { | |
| reverse_proxy 127.0.0.1:8787 | |
| } | |
| # Route root /v1 to opencode-router for standard OpenAI API clients | |
| handle /v1/* { | |
| reverse_proxy 127.0.0.1:8787 | |
| } | |
| # 5. Diagnostic logs & REA status | |
| handle /logs/* { | |
| uri strip_prefix /logs | |
| root * /tmp/logs | |
| file_server browse | |
| } | |
| handle /rea-status.json { | |
| root * /tmp/logs | |
| file_server | |
| } | |
| # 6. Ekko Studio Web UI fallback at root (serves on 8648) | |
| handle { | |
| reverse_proxy 127.0.0.1:8648 | |
| } | |
| } | |