diff --git a/app/(dashboard)/proxy-hosts/ProxyHostsClient.tsx b/app/(dashboard)/proxy-hosts/ProxyHostsClient.tsx
index ec6c9366..d691a0aa 100644
--- a/app/(dashboard)/proxy-hosts/ProxyHostsClient.tsx
+++ b/app/(dashboard)/proxy-hosts/ProxyHostsClient.tsx
@@ -113,6 +113,7 @@ export default function ProxyHostsClient({ hosts, certificates, accessLists }: P
Name
Domains
Upstreams
+ Certificate
Status
Actions
@@ -120,79 +121,91 @@ export default function ProxyHostsClient({ hosts, certificates, accessLists }: P
{hosts.length === 0 ? (
-
+
No proxy hosts configured. Click "Create Host" to add one.
) : (
- hosts.map((host) => (
-
-
-
- {host.name}
-
-
-
-
- {host.domains.slice(0, 2).join(", ")}
- {host.domains.length > 2 && ` +${host.domains.length - 2} more`}
-
-
-
-
- {host.upstreams.slice(0, 2).join(", ")}
- {host.upstreams.length > 2 && ` +${host.upstreams.length - 2} more`}
-
-
-
-
-
-
-
-
- setEditHost(host)}
- sx={{
- color: "rgba(99, 102, 241, 0.8)",
- "&:hover": { bgcolor: "rgba(99, 102, 241, 0.1)" }
- }}
- >
-
-
-
-
- setDeleteHost(host)}
- sx={{
- color: "rgba(239, 68, 68, 0.8)",
- "&:hover": { bgcolor: "rgba(239, 68, 68, 0.1)" }
- }}
- >
-
-
-
-
-
-
- ))
+ hosts.map((host) => {
+ const certificate = host.certificate_id
+ ? certificates.find(c => c.id === host.certificate_id)
+ : null;
+ const certName = certificate?.name ?? "Managed by Caddy (Auto)";
+
+ return (
+
+
+
+ {host.name}
+
+
+
+
+ {host.domains.slice(0, 2).join(", ")}
+ {host.domains.length > 2 && ` +${host.domains.length - 2} more`}
+
+
+
+
+ {host.upstreams.slice(0, 2).join(", ")}
+ {host.upstreams.length > 2 && ` +${host.upstreams.length - 2} more`}
+
+
+
+
+ {certName}
+
+
+
+
+
+
+
+
+ setEditHost(host)}
+ sx={{
+ color: "rgba(99, 102, 241, 0.8)",
+ "&:hover": { bgcolor: "rgba(99, 102, 241, 0.1)" }
+ }}
+ >
+
+
+
+
+ setDeleteHost(host)}
+ sx={{
+ color: "rgba(239, 68, 68, 0.8)",
+ "&:hover": { bgcolor: "rgba(239, 68, 68, 0.1)" }
+ }}
+ >
+
+
+
+
+
+
+ );
+ })
)}
diff --git a/app/(dashboard)/proxy-hosts/actions.ts b/app/(dashboard)/proxy-hosts/actions.ts
index 5b46cb6a..2c8e0173 100644
--- a/app/(dashboard)/proxy-hosts/actions.ts
+++ b/app/(dashboard)/proxy-hosts/actions.ts
@@ -120,8 +120,12 @@ export async function updateProxyHostAction(
name: formData.get("name") ? String(formData.get("name")) : undefined,
domains: formData.get("domains") ? parseCsv(formData.get("domains")) : undefined,
upstreams: formData.get("upstreams") ? parseCsv(formData.get("upstreams")) : undefined,
- certificate_id: formData.get("certificate_id") ? Number(formData.get("certificate_id")) : undefined,
- access_list_id: formData.get("access_list_id") ? Number(formData.get("access_list_id")) : undefined,
+ certificate_id: formData.has("certificate_id")
+ ? (formData.get("certificate_id") ? Number(formData.get("certificate_id")) : null)
+ : undefined,
+ access_list_id: formData.has("access_list_id")
+ ? (formData.get("access_list_id") ? Number(formData.get("access_list_id")) : null)
+ : undefined,
hsts_subdomains: boolField("hsts_subdomains"),
skip_https_hostname_validation: boolField("skip_https_hostname_validation"),
enabled: boolField("enabled"),
diff --git a/src/lib/models/proxy-hosts.ts b/src/lib/models/proxy-hosts.ts
index 935f9bd3..08f7cd13 100644
--- a/src/lib/models/proxy-hosts.ts
+++ b/src/lib/models/proxy-hosts.ts
@@ -482,8 +482,8 @@ export async function updateProxyHost(id: number, input: Partial
name: input.name ?? existing.name,
domains,
upstreams,
- certificateId: input.certificate_id ?? existing.certificate_id,
- accessListId: input.access_list_id ?? existing.access_list_id,
+ certificateId: input.certificate_id !== undefined ? input.certificate_id : existing.certificate_id,
+ accessListId: input.access_list_id !== undefined ? input.access_list_id : existing.access_list_id,
sslForced: input.ssl_forced ?? existing.ssl_forced,
hstsEnabled: input.hsts_enabled ?? existing.hsts_enabled,
hstsSubdomains: input.hsts_subdomains ?? existing.hsts_subdomains,