Marzban serves the subscription at https://your-domain/sub/<token>/; for unknown clients it returns Base64 links, which nya reads directly.
| Path | Returns | For nya |
|---|---|---|
/sub/<token>/ | Client detected by User-Agent; Base64 links for nya | Recommended |
/sub/<token>/v2ray | Base64 links | OK |
/sub/<token>/v2ray-json | Xray JSON | OK for custom templates |
/sub/<token>/clash-meta | Clash Meta / Mihomo YAML | OK |
/sub/<token>/sing-box | sing-box JSON | OK |
Headers
Marzban sends subscription-userinfo, profile-title, profile-update-interval, support-url and profile-web-page-url, configured in .env:
SUB_PROFILE_TITLE="My VPN"
SUB_SUPPORT_URL="https://t.me/my_support"
SUB_UPDATE_INTERVAL="12"What's missing
No announce, routing, renew-url or HWID. Add headers for nya in nginx:
# map goes in the http block
map $http_user_agent $nya_renew { default ""; "~*^nya/" "https://t.me/my_vpn_bot?start=renew"; }
location /sub/ {
proxy_pass http://127.0.0.1:8000;
proxy_set_header Host $host;
add_header renew-url $nya_renew always;
}Forks keep the /sub/… paths and headers. If a fork supports User-Agent rules, use “starts with nya/”.