diff --git a/docs/content/docs/en/config/subscription.mdx b/docs/content/docs/en/config/subscription.mdx
index f22d74653..306d9e8c5 100644
--- a/docs/content/docs/en/config/subscription.mdx
+++ b/docs/content/docs/en/config/subscription.mdx
@@ -38,6 +38,22 @@ URLs and preview both bodies here:
+## Replacing nodes after an HWID rejection
+
+In **Panel settings → Subscription**, enable **Replace configs when HWID is
+rejected** (`subHwidRejectWithConfig`, off by default). When HWID is missing or
+the device limit is reached, the server returns HTTP 200 with a non-working
+node instead of 404. This supports raw/base64 links, Xray JSON, Clash/Mihomo,
+legacy Clash, and automatic format detection. Compatible apps can accept the
+update and replace previously downloaded nodes. With this option off, the
+existing 404 response and HWID error headers are preserved.
+
+Replacement requires the app to refresh and accept the subscription. It does
+not revoke copied credentials or immediately terminate existing connections.
+Deleting a device only frees its slot: it can register again if a slot is
+available. To reject it after deletion, the remaining devices must fill the
+configured limit.
+
## Output formats
The **format is chosen by path**, each with its own enable toggle:
diff --git a/docs/content/docs/ru/config/subscription.mdx b/docs/content/docs/ru/config/subscription.mdx
index e0c2fbb36..6fdb71c74 100644
--- a/docs/content/docs/ru/config/subscription.mdx
+++ b/docs/content/docs/ru/config/subscription.mdx
@@ -9,6 +9,24 @@ icon: Rss
входящего соединения клиенты подхватывают изменения автоматически. Сервер
подписок работает как **отдельный** сервер от панели.
+## Замена узлов при отказе по HWID
+
+В разделе **Настройки панели → Подписка** включите **Заменять конфиги при
+отказе по HWID** (`subHwidRejectWithConfig`, по умолчанию выключено).
+При отсутствии HWID или достижении лимита устройств сервер вернёт HTTP 200
+с нерабочим узлом вместо 404. Поддерживаются обычные и base64-ссылки, Xray JSON,
+Clash/Mihomo, старый Clash и автоматическое определение формата. Совместимое
+приложение сможет принять обновление и заменить ранее загруженные узлы.
+При выключенной настройке сохраняются ответ 404 и заголовки ошибки HWID.
+
+
+
+Замена происходит только после обновления подписки приложением. Она не
+отзывает скопированные ключи и не разрывает существующие соединения.
+Удаление устройства освобождает место: если лимит позволяет, устройство
+сможет зарегистрироваться снова. Чтобы оно получило отказ после удаления,
+оставшиеся устройства должны заполнять установленный лимит.
+
## Включение и настройка
Сервер подписок **включён по умолчанию** (`subEnable`). Настройте его в
diff --git a/docs/public/images/subscription-hwid-rejection.png b/docs/public/images/subscription-hwid-rejection.png
new file mode 100644
index 000000000..6007b971e
Binary files /dev/null and b/docs/public/images/subscription-hwid-rejection.png differ
diff --git a/docs/public/openapi.json b/docs/public/openapi.json
index 20cd85b2c..6de95b17d 100644
--- a/docs/public/openapi.json
+++ b/docs/public/openapi.json
@@ -354,6 +354,9 @@
"example": "inbound-first",
"type": "string"
},
+ "subHwidRejectWithConfig": {
+ "type": "boolean"
+ },
"subIncyAnnounceUrl": {
"type": "string"
},
@@ -710,6 +713,7 @@
"subHappTunType",
"subHideSettings",
"subHostSortMode",
+ "subHwidRejectWithConfig",
"subIncyAnnounceUrl",
"subIncyAppAutoDetect",
"subIncyBannerBgColor",
@@ -1145,6 +1149,9 @@
"example": "inbound-first",
"type": "string"
},
+ "subHwidRejectWithConfig": {
+ "type": "boolean"
+ },
"subIncyAnnounceUrl": {
"type": "string"
},
@@ -1509,6 +1516,7 @@
"subHappTunType",
"subHideSettings",
"subHostSortMode",
+ "subHwidRejectWithConfig",
"subIncyAnnounceUrl",
"subIncyAppAutoDetect",
"subIncyBannerBgColor",
diff --git a/frontend/public/openapi.json b/frontend/public/openapi.json
index 20cd85b2c..6de95b17d 100644
--- a/frontend/public/openapi.json
+++ b/frontend/public/openapi.json
@@ -354,6 +354,9 @@
"example": "inbound-first",
"type": "string"
},
+ "subHwidRejectWithConfig": {
+ "type": "boolean"
+ },
"subIncyAnnounceUrl": {
"type": "string"
},
@@ -710,6 +713,7 @@
"subHappTunType",
"subHideSettings",
"subHostSortMode",
+ "subHwidRejectWithConfig",
"subIncyAnnounceUrl",
"subIncyAppAutoDetect",
"subIncyBannerBgColor",
@@ -1145,6 +1149,9 @@
"example": "inbound-first",
"type": "string"
},
+ "subHwidRejectWithConfig": {
+ "type": "boolean"
+ },
"subIncyAnnounceUrl": {
"type": "string"
},
@@ -1509,6 +1516,7 @@
"subHappTunType",
"subHideSettings",
"subHostSortMode",
+ "subHwidRejectWithConfig",
"subIncyAnnounceUrl",
"subIncyAppAutoDetect",
"subIncyBannerBgColor",
diff --git a/frontend/src/generated/examples.ts b/frontend/src/generated/examples.ts
index 384de907c..a27d4e144 100644
--- a/frontend/src/generated/examples.ts
+++ b/frontend/src/generated/examples.ts
@@ -101,6 +101,7 @@ export const EXAMPLES: Record = {
"subHappTunType": "",
"subHideSettings": false,
"subHostSortMode": "inbound-first",
+ "subHwidRejectWithConfig": false,
"subIncyAnnounceUrl": "",
"subIncyAppAutoDetect": false,
"subIncyBannerBgColor": "",
@@ -291,6 +292,7 @@ export const EXAMPLES: Record = {
"subHappTunType": "",
"subHideSettings": false,
"subHostSortMode": "inbound-first",
+ "subHwidRejectWithConfig": false,
"subIncyAnnounceUrl": "",
"subIncyAppAutoDetect": false,
"subIncyBannerBgColor": "",
diff --git a/frontend/src/generated/schemas.ts b/frontend/src/generated/schemas.ts
index 479ec9fdb..e659059a5 100644
--- a/frontend/src/generated/schemas.ts
+++ b/frontend/src/generated/schemas.ts
@@ -328,6 +328,9 @@ export const SCHEMAS: Record = {
"example": "inbound-first",
"type": "string"
},
+ "subHwidRejectWithConfig": {
+ "type": "boolean"
+ },
"subIncyAnnounceUrl": {
"type": "string"
},
@@ -684,6 +687,7 @@ export const SCHEMAS: Record = {
"subHappTunType",
"subHideSettings",
"subHostSortMode",
+ "subHwidRejectWithConfig",
"subIncyAnnounceUrl",
"subIncyAppAutoDetect",
"subIncyBannerBgColor",
@@ -1119,6 +1123,9 @@ export const SCHEMAS: Record = {
"example": "inbound-first",
"type": "string"
},
+ "subHwidRejectWithConfig": {
+ "type": "boolean"
+ },
"subIncyAnnounceUrl": {
"type": "string"
},
@@ -1483,6 +1490,7 @@ export const SCHEMAS: Record = {
"subHappTunType",
"subHideSettings",
"subHostSortMode",
+ "subHwidRejectWithConfig",
"subIncyAnnounceUrl",
"subIncyAppAutoDetect",
"subIncyBannerBgColor",
diff --git a/frontend/src/generated/types.ts b/frontend/src/generated/types.ts
index c9d50cfc6..f010d9865 100644
--- a/frontend/src/generated/types.ts
+++ b/frontend/src/generated/types.ts
@@ -110,6 +110,7 @@ export interface AllSetting {
subHappTunType: string;
subHideSettings: boolean;
subHostSortMode: string;
+ subHwidRejectWithConfig: boolean;
subIncyAnnounceUrl: string;
subIncyAppAutoDetect: boolean;
subIncyBannerBgColor: string;
@@ -301,6 +302,7 @@ export interface AllSettingView {
subHappTunType: string;
subHideSettings: boolean;
subHostSortMode: string;
+ subHwidRejectWithConfig: boolean;
subIncyAnnounceUrl: string;
subIncyAppAutoDetect: boolean;
subIncyBannerBgColor: string;
diff --git a/frontend/src/generated/zod.ts b/frontend/src/generated/zod.ts
index d86fa6391..ccb84c6fa 100644
--- a/frontend/src/generated/zod.ts
+++ b/frontend/src/generated/zod.ts
@@ -128,6 +128,7 @@ export const AllSettingSchema = z.object({
subHappTunType: z.string(),
subHideSettings: z.boolean(),
subHostSortMode: z.string(),
+ subHwidRejectWithConfig: z.boolean(),
subIncyAnnounceUrl: z.string(),
subIncyAppAutoDetect: z.boolean(),
subIncyBannerBgColor: z.string(),
@@ -320,6 +321,7 @@ export const AllSettingViewSchema = z.object({
subHappTunType: z.string(),
subHideSettings: z.boolean(),
subHostSortMode: z.string(),
+ subHwidRejectWithConfig: z.boolean(),
subIncyAnnounceUrl: z.string(),
subIncyAppAutoDetect: z.boolean(),
subIncyBannerBgColor: z.string(),
diff --git a/frontend/src/models/setting.ts b/frontend/src/models/setting.ts
index 1dcf9abaf..2b356f75a 100644
--- a/frontend/src/models/setting.ts
+++ b/frontend/src/models/setting.ts
@@ -20,6 +20,7 @@ export class AllSetting {
remarkTemplate = '{{INBOUND}}-{{EMAIL}}|📊{{TRAFFIC_LEFT}}|⏳{{DAYS_LEFT}}D';
subShowIdentityOnAllLinks = false;
subInfoNodeEnable = false;
+ subHwidRejectWithConfig = false;
subHostSortMode: SubHostSortMode = 'inbound-first';
subCalendarExpireInclusive = false;
subExpiredTemplate = '⛔ {{EMAIL}} | Expired: {{EXPIRE_DATE}}';
diff --git a/frontend/src/pages/settings/SubscriptionGeneralTab.tsx b/frontend/src/pages/settings/SubscriptionGeneralTab.tsx
index 94a1fd12b..9b85e95fd 100644
--- a/frontend/src/pages/settings/SubscriptionGeneralTab.tsx
+++ b/frontend/src/pages/settings/SubscriptionGeneralTab.tsx
@@ -95,6 +95,17 @@ export default function SubscriptionGeneralTab({
}
/>
)}
+
+ updateSetting({ subHwidRejectWithConfig: v })}
+ />
+