Serve per-client clash.yaml dynamically via mtr-backend
- clash.yaml template: proxy-provider URL uses ${SUB_ID} placeholder
- install_clash_sub() saves to clash.yaml.tpl (DOMAIN/SUB_PATH substituted, SUB_ID left)
- mtr-backend GET /api/clash?sub_id=xxx reads .tpl, fills in subscription ID, returns YAML
- nginx regex ^/sub_path/(?<clash_sub_id>[^/]*)$ proxies Clash UA to
mtr-backend /api/clash?sub_id=$clash_sub_id; regular clients pass through to x-ui
- Removed static /__clash_sub internal location
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
d9a51d7199
commit
9bb6ed5d5c
@@ -19,7 +19,7 @@ lgbm-url: "https://github.com/vernesong/mihomo/releases/download/LightGBM-Model/
|
||||
proxy-providers:
|
||||
sub:
|
||||
type: http
|
||||
url: https://${DOMAIN}/${SUB_PATH}/
|
||||
url: https://${DOMAIN}/${SUB_PATH}/${SUB_ID}
|
||||
path: ./proxy_providers/base64.yml
|
||||
interval: 3600
|
||||
health-check:
|
||||
|
||||
Reference in New Issue
Block a user