Skip to content
Dorian FINKEL
CloudflareNginx Proxy ManagerLet’s EncryptLessons learned · 2025 · 3 min read · Updated 9 October 2026

Publishing sites behind Cloudflare and Nginx Proxy Manager

A domain name, a proxy in front, a reverse proxy at home: every site answers over valid HTTPS without showing the home address in DNS. And the limit of this setup, which later led to the tunnel.

01The starting point

Each service had its own IP and port, self-signed certificates, and publishing a site meant handing the home address to whoever asked. None of that scales, or reassures.

02Cloudflare in front

The domains are managed at Cloudflare in proxy mode (the orange cloud). Public DNS no longer returns the home address but Cloudflare’s: the visitor connects to Cloudflare, which opens its own connection to the house and relays the request.

The origin address therefore no longer appears in the DNS of proxied names, and Cloudflare absorbs some unwanted traffic along the way.

03Encryption all the way: Full (strict)

Two TLS connections follow each other: visitor to Cloudflare, then Cloudflare to the house. “Flexible” SSL mode leaves the second one in clear HTTP; “Full” encrypts it without checking the certificate. Only “Full (strict)” requires a valid certificate at home: that is the chosen setting, made possible by Let’s Encrypt certificates.

04Nginx Proxy Manager behind

At home there is a single entry point: Nginx Proxy Manager. It receives everything coming from Cloudflare and reads the requested hostname to pick the service. Adding a site means adding a host, not opening another port.

Useful detail: the logs see Cloudflare’s address, not the visitor’s. Cloudflare passes it in the CF-Connecting-IP header, which the proxy must be configured to trust, and only from Cloudflare’s address ranges.

Example · Nginx Proxy Manager
# One host per domain name → the internal service
nextcloud.example.com   →  http://192.168.20.11:11000
grafana.example.com     →  http://192.168.20.12:3000
vault.example.com       →  http://192.168.20.13:8080

05Certificates without opening a port

Let’s Encrypt certificates are obtained through the DNS-01 challenge: instead of proving control of a web server, you prove control of the domain by creating a TXT record, here through the Cloudflare API. It is also the only method that issues a wildcard certificate, valid for every subdomain.

The API token only gets the right to edit DNS for that zone, nothing else.

Example · DNS
# Created for the validation, then deleted
_acme-challenge.example.com.   TXT   "<token provided by Let's Encrypt>"

# Cloudflare API token: minimal rights
Zone · DNS · Edit     (example.com zone only)

06The limit: port 443 stays open

Hiding the address in DNS does not close it. It can be found in other ways: archived DNS history, a non-proxied subdomain, an MX record, or simply a scan of the whole IPv4 space. Anyone who knows it can then talk directly to the reverse proxy, bypassing Cloudflare.

Two mitigations exist: allow only Cloudflare’s published address ranges on 443, or require a Cloudflare client certificate (Authenticated Origin Pulls). The definitive fix was to open nothing at all, with Cloudflare Tunnel.

07And DNS at home

Internally, AdGuard Home is the network’s resolver: it filters ads and malicious domains, knows the services’ names through DNS rewrites, and queries upstream over DNS-over-HTTPS: the ISP no longer sees the queries.

Key takeaways

  • Public DNS only returns Cloudflare addresses.
  • SSL in Full (strict): encrypted and verified all the way home.
  • One entry point at home: NPM, one host per name.
  • DNS-01: wildcard certificates without opening a port.
  • Hiding isn’t closing: restrict 443 to Cloudflare ranges, or move to the tunnel.

Example domain and addresses.

Official sources