From 0453ddca350b0607501d163a0519ff9e1329901d Mon Sep 17 00:00:00 2001 From: vzagorovskiy Date: Fri, 28 Aug 2026 12:02:52 +0300 Subject: [PATCH] Use the row's own model and host type in regenerate-config processItems() passed proxyHostModel and the literal "proxy_host" to configure() for every host type. host_type selects both the template and the output path, and each host type has its own id sequence, so redirection hosts, 404 hosts and streams were rendered through proxy_host.conf and written over /data/nginx/proxy_host/.conf. The proxy host sharing that id lost its config file and had the resulting nginx error recorded in its own meta. --- backend/scripts/regenerate-config | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/backend/scripts/regenerate-config b/backend/scripts/regenerate-config index 00f8411310..1965777220 100755 --- a/backend/scripts/regenerate-config +++ b/backend/scripts/regenerate-config @@ -46,7 +46,7 @@ const logIt = (msg, type = "info") => logger[type]( // Let's do it. -const processItems = async (model, type) => { +const processItems = async (model, type, hostType) => { const rows = await model .query() .where("is_deleted", 0) @@ -60,17 +60,17 @@ const processItems = async (model, type) => { for (const row of rows) { if (!DRY_RUN) { logIt(`[${type}] Regenerating config #${row.id}: ${row.domain_names ? row.domain_names.join(", ") : 'port ' + row.incoming_port}`); - await internalNginx.configure(proxyHostModel, "proxy_host", row); + await internalNginx.configure(model, hostType, row); } else { logIt(`[${type}] Skipping generation of config #${row.id}: ${row.domain_names ? row.domain_names.join(", ") : 'port ' + row.incoming_port}`); } } }; -await processItems(proxyHostModel, "Proxy Host"); -await processItems(redirectionHostModel, "Redirection Host"); -await processItems(deadHostModel, "404 Host"); -await processItems(streamModel, "Stream"); +await processItems(proxyHostModel, "Proxy Host", "proxy_host"); +await processItems(redirectionHostModel, "Redirection Host", "redirection_host"); +await processItems(deadHostModel, "404 Host", "dead_host"); +await processItems(streamModel, "Stream", "stream"); logIt("Completed", "success"); process.exit(0);