Thanks for all your replies.
Please let me clarify the aim of my request.
The goal is to implement a resilient Zero Trust (Never Trust, Always Verify) architecture—free of externally open ports (No Open Ports / Stealth Mode)—capable of ensuring secure access to the Homey Pro Mini management interface (private.domain.tld), both locally (with or without an Internet connection) and remotely.
Who I am:
Drawing on over 30 years of experience in the IT sector (Chief System and Solution Architect at a major pan-European bank).
** I can confirm that I have succeeded; however, this is an extremely complex configuration that cannot be implemented by anyone lacking the necessary expertise. Homey is not the only thing I manage in such a way at my home. For Surveillance and Alarm System I use a similar setup but with additional security enforcements. Indeed, SSL/TLS/mTLS security is crucial even at the local level; that is precisely why I started this discussion.
To achieve a seamless user experience, the system architecture must guarantee an identical access URL and workflow (private.domain.tld) regardless of whether the request originates from the internal network (LAN) or over the Internet (WAN).
Having said that, let me share the Architectural Rationale (this is also what I have currently implemented).
Due to configuration limits/constraints (I suppose) of the Homey Pro (Mini as well), that manage (I suppose) only WILDCARD certificate *.homey.homeylocal.com, direct local web connections to the hub are served exclusively over HTTP on port 80 without native TLS/HTTPS termination or port remapping capabilities. Consequently, to maintain absolute symmetry between local and remote access without introducing client-side port changes or complex local proxying for LAN clients, all traffic inbound to the Homey Pro Mini must ultimately reach 10.0.1.50 on port 80.
Security and Zero Trust enforcement (HTTPS termination, MFA authentication, rate limiting, and JWT validation) are offloaded entirely to the edge (Cloudflare Access) and the perimeter proxy (NGINX in DMZ), ensuring that the unencrypted HTTP interface on port 80 remains fully isolated inside the Management VLAN and reachable only via explicit firewall pin-holes.
Topological Architecture & Network Diagram
Remarks: All subnets and IP addresses are examples.
The UniFi Cloud Gateway manages Internet access and operates as an inter-VLAN router, L3/L4 stateful firewall, IPS/IDS threat management engine, and SIEM log collector. The internal network is divided into four strictly segregated VLANs, and public/WAN services are structured into three distinct public blocks (Internet, Cloudflare Edge & Zero Trust, Google IdP):
-
Internet Block: Remote clients on the public WAN.
-
Cloudflare Services Block: Public DNS, Cloudflare Access Gateway, and Cloudflare Tunnel Edge.
-
Google Identity Provider Block: Single OAuth2/OIDC Service Provider for multi-factor authentication.
-
VLAN DMZ (172.16.0.0/24): Hosts the cloudflared daemon and the NGINX reverse proxy.
-
VLAN Security (10.0.0.0/24): Hosts the local DNS server (AdGuard/Pi-hole/Unbound) and the SIEM server.
-
VLAN Management (10.0.1.0/24): Dedicated exclusively to the Homey Pro Mini hub.
-
VLAN Home (192.168.1.0/24): Hosts local client devices (browsers, smartphones).
Detailed Connection & Resolution Flows
Scenario A — Local Access (VLAN Home 192.168.1.0/24)
-
DNS Resolution: The local client 192.168.1.x queries the Local DNS (10.0.0.2 in VLAN Security). The UniFi firewall permits the inter-VLAN DNS query. The local DNS server responds directly with the private IP 10.0.1.50.
-
Routing & Firewall: The HTTP packet is routed to the UniFi gateway. The Inter-VLAN rule allows traffic originating from VLAN Home directed toward the Homey Pro Mini IP in VLAN Management on port 80.
-
Response: The HTTP/WebSocket session is established directly within the local network on port 80.
Scenario B — Remote Access (WAN / Internet)
-
Public DNS Resolution (Internet Block → Cloudflare Block): The remote client on the Internet queries Cloudflare Public DNS, which returns Cloudflare’s Anycast Edge IP addresses.
-
OIDC Authentication (Cloudflare Block ↔ Google Block): The remote client reaches Cloudflare Access. If no active session exists, Cloudflare redirects the browser to the Google Identity Provider block. Following successful MFA authentication, Google validates credentials and issues an OIDC token back to Cloudflare Access.
-
Cloudflare Tunnel Transport: The Cloudflare Edge forwards encrypted traffic to the cloudflared daemon running inside the DMZ (172.16.0.10), which maintains an active outbound tunnel through the UniFi Cloud Gateway WAN interface.
-
Proxying & Header Enforcement: cloudflared proxies the request to NGINX (172.16.0.20). NGINX verifies the presence and validity of the cf-access-jwt-assertion JWT header before proxying to the Management VLAN.
-
Firewall Pin-Hole: NGINX forwards the HTTP request to 10.0.1.50:80. The UniFi firewall evaluates the inter-VLAN traffic against the Pin-Hole rule: it strictly allows traffic coming from 172.16.0.20 destined for 10.0.1.50:80 (VLAN Management), dropping all other unauthorized DMZ traffic.
-
SIEM Logging: The UniFi Cloud Gateway and NGINX send audit and event logs to the SIEM Server(10.0.0.100 in VLAN Security).
Resolution Matrix & VLAN Segmentation
| Block / Segment |
Subnet / IP / Scope |
Connection Type |
Security & Control Rule |
| 1. Internet |
External (WAN) |
Ingress Client |
External remote clients requesting DNS resolution and connection to homey.domusaurea.digital. |
| 2. Cloudflare Services |
Cloudflare Edge / Anycast |
Proxy & Gateway Auth |
Manages public DNS, enforces Access policies, and terminates the Cloudflare Tunnel. |
| 3. Google Identity |
External (Google Cloud) |
OIDC / OAuth2 |
Sole Identity Provider for strong user multi-factor authentication (MFA) via Cloudflare Access redirect. |
| VLAN DMZ |
172.16.0.0/24 |
Outbound Tunnel / Local Proxy |
Hosts cloudflared (.10) and NGINX (.20). Completely isolated from internal VLANs except for the explicit Pin-Hole rule. |
| VLAN Security |
10.0.0.0/24 |
Security Infrastructure |
Hosts Local DNS (.2) and SIEM Server (.100). Receives syslog data from DMZ and Gateway; serves DNS queries from Home VLAN. |
| VLAN Management |
10.0.1.0/24 |
IoT Hub Core |
Exclusively hosts Homey Pro Mini (.50). Accessible only on Port 80 HTTP via direct LAN routing or DMZ Pin-Hole. |
| VLAN Home |
192.168.1.0/24 |
User Subnet |
Permitted access to Local DNS (10.0.0.2:53) and Homey Pro Mini (10.0.1.50:80). |
| UniFi Firewall |
Edge Router |
Inter-VLAN Routing & Pin-Hole |
Implements a Default Drop policy for all Inter-VLAN traffic, with selective exceptions defined by explicit firewall rules. |
Identity Provider Integration Requirements (Google OIDC)
To enable Cloudflare Access for validating user identity through the Google Identity Provider block, OAuth 2.0 credentials must be configured (e.g., Google Cloud is used by me):
-
Console: Google Cloud Console (console.cloud.google.com).
-
Credentials: Create an OAuth 2.0 Client ID (Application type: Web Application).
-
Authorized Redirect URI: https://<your-team>[.cloudflareaccess.com/cdn-cgi/access/callback](https://.cloudflareaccess.com/cdn-cgi/access/callback).
-
Cloudflare Access Configuration:
-
Open the Cloudflare Zero Trust dashboard → Settings → Authentication.
-
Add a new Identity Provider and select Google.
-
Enter the Client ID and Client Secret generated in Google Cloud Console.
Component Configurations
5.1 NGINX Reverse Proxy Configuration (DMZ - 172.16.0.20)
NGINX configuration file (/etc/nginx/sites-available/homey.conf)
… (omitted) …
5.2 UniFi Cloud Gateway Firewall Rules
-
Rule 1: Pin-Hole DMZ to Homey (Inter-VLAN ACCEPT)
-
Action: ACCEPT
-
Source Type: Single IP → 172.16.0.20 (NGINX Proxy in DMZ)
-
Destination Type: Single IP → 10.0.1.50 (Homey Pro Mini in Management)
-
Destination Port: 80 (HTTP)
-
Logging: Enabled
-
Rule 2: Allow DMZ to SIEM (Logging ACCEPT)
-
Action: ACCEPT
-
Source Type: Single IP → 172.16.0.20 (NGINX Proxy in DMZ)
-
Destination Type: Single IP → 10.0.0.100 (SIEM Server in Security VLAN)
-
Destination Port: 514 (Syslog UDP/TCP) or dedicated SIEM port
-
Logging: Disabled
-
Rule 3: Allow LAN Home to Homey (Inter-VLAN ACCEPT)
-
Action: ACCEPT
-
Source Type: Network → VLAN Home (192.168.1.0/24)
-
Destination Type: Single IP → 10.0.1.50 (Homey Pro Mini in Management)
-
Destination Port: 80 (HTTP)
-
Logging: Disabled
-
Rule 4: Allow LAN Home to Local DNS (Inter-VLAN ACCEPT)
-
Action: ACCEPT
-
Source Type: Network → VLAN Home (192.168.1.0/24)
-
Destination Type: Single IP → 10.0.0.2 (Local DNS in Security VLAN)
-
Destination Port: 53 (UDP/TCP)
-
Logging: Disabled
-
Rule 5: Drop All Inter-VLAN Traffic (Default Drop)