Restore the 404 page but allow the kamal health check

This commit is contained in:
Mike Dalessio
2025-03-20 11:36:32 -04:00
parent 987e420d05
commit 33719b588c
+5 -3
View File
@@ -1,9 +1,11 @@
Rails.application.config.after_initialize do
# in production, we're using a two-level subdomain like "tenant.fizzy.37signals.com", but in
# development and beta it's only a single-level subdomain.
Rails.application.config.active_record_tenanted.tenant_resolver = ->(request) do
# in production, we're using a two-level subdomain like "tenant.fizzy.37signals.com", but in
# development and beta it's only a single-level subdomain.
next nil if request.path == "/up"
tld_length = request.domain == "37signals.com" ? 2 : 1
request.subdomain(tld_length).presence # || "no-such-tenant-exists" # this is a quick fix for now
request.subdomain(tld_length).presence || "return-404" # this is a quick fix for now
end
end