fix(domains): improve shared Nginx reconciliation logic in domain routes
This commit is contained in:
1 parent
f38f8f16d3
commit
e097467c95
2 files changed
+14
-2
No files matched your search
@@ -41,6 +41,13 @@ const securityHeaders = [
|
||||
const nextConfig: NextConfig = {
|
||||
allowedDevOrigins: ["localhost", "127.0.0.1", "192.168.12.11"],
|
||||
devIndicators: false,
|
||||
experimental: {
|
||||
// Domain provisioning can include SSH, Nginx validation/reload, and
|
||||
// Certbot work. Keep the same-origin rewrite alive long enough for the
|
||||
// backend to return its structured result instead of a proxy-generated
|
||||
// non-JSON 500 response.
|
||||
proxyTimeout: 5 * 60 * 1000,
|
||||
},
|
||||
async rewrites() {
|
||||
const backendUrl =
|
||||
process.env.INTERNAL_API_URL ||
|
||||
|
||||
@@ -1837,8 +1837,13 @@ export async function domainRoutes(app: FastifyInstance) {
|
||||
const willBeSharedNginx = isSharedNginxConfig(nextInput);
|
||||
const previousRootDomain = getDomainConfigAnchor([existing.name]);
|
||||
const nextRootDomain = getDomainConfigAnchor([nextInput.name]);
|
||||
const previousSharedGroupNames =
|
||||
const shouldReconcilePreviousShared =
|
||||
wasSharedNginx &&
|
||||
(!willBeSharedNginx ||
|
||||
existing.serverId !== (nextInput.serverId ?? null) ||
|
||||
previousRootDomain !== nextRootDomain);
|
||||
const previousSharedGroupNames =
|
||||
shouldReconcilePreviousShared &&
|
||||
existing.serverId &&
|
||||
existing.targetContainerId &&
|
||||
existing.targetPort
|
||||
@@ -1938,7 +1943,7 @@ export async function domainRoutes(app: FastifyInstance) {
|
||||
});
|
||||
|
||||
if (
|
||||
wasSharedNginx &&
|
||||
shouldReconcilePreviousShared &&
|
||||
existing.serverId &&
|
||||
existing.targetContainerId &&
|
||||
existing.targetPort
|
||||
|
||||
Reference in new issue
Block a user