RU

Marzban and forks

Marzban, PasarGuard and other builds based on it.

Marzban serves the subscription at https://your-domain/sub/<token>/; for unknown clients it returns Base64 links, which nya reads directly.

PathReturnsFor nya
/sub/<token>/Client detected by User-Agent; Base64 links for nyaRecommended
/sub/<token>/v2rayBase64 linksOK
/sub/<token>/v2ray-jsonXray JSONOK for custom templates
/sub/<token>/clash-metaClash Meta / Mihomo YAMLOK
/sub/<token>/sing-boxsing-box JSONOK

Headers

Marzban sends subscription-userinfo, profile-title, profile-update-interval, support-url and profile-web-page-url, configured in .env:

Terminal
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:

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/”.