Skip to content

Nginx Proxy Manager

Access your home services via a secure URL from anywhere in the world. This guide covers setting up AdGuard Home for custom DNS, Nginx Proxy Manager for wildcard SSL certificates via Cloudflare and Tailscale for a zero-config VPN mesh.



  1. Deploy AdGuard Home and Nginx Proxy Manager as containerized services for network filtering and reverse proxying.

    1. Terminal window
      mkdir -p {{DOCKER_PATH_VAR}}/dns-proxy && cd {{DOCKER_PATH_VAR}}/dns-proxy
    2. Terminal window
      nano compose.yml
      compose.yml
      services:
      adguard:
      image: adguard/adguardhome
      container_name: adguard
      restart: unless-stopped
      volumes:
      - ./adguard/work:/opt/adguardhome/work
      - ./adguard/conf:/opt/adguardhome/conf
      network_mode: host
      npm:
      image: "jc21/nginx-proxy-manager:latest"
      container_name: npm
      restart: unless-stopped
      network_mode: host
      volumes:
      - ./npm/data:/data
      - ./npm/letsencrypt:/etc/letsencrypt
      environment:
      - DB_SQLITE_FILE=/data/database.sqlite

    3. Terminal window
      sudo nano /etc/systemd/resolved.conf

      Set DNSStubListener=no

      Terminal window
      sudo systemctl restart systemd-resolved
    4. Terminal window
      docker compose up -d
  2. Generate a scoped API token to automate DNS record management and SSL certificate validation.

    • Go to Dashboard > My Profile > API Tokens.
    • Create Token: Use the Edit zone DNS template.
    • Permissions: Select Zone | DNS | Edit.
    • Zone Resources: Select Include | Specific zone | your-domain.tld.

  3. Complete the initial web setup to manage network-wide DNS filtering and security rules.



      1. Preconfigured list
        • Go to Filters > DNS Blocklists > Add Blocklist: Choose from the list.
          • AdGuard DNS filter
          • AdAway Default Blocklist
          • HaGeZi’s Pro++ Blocklist
          • OISD Blocklist Small
          • OISD Blocklist Big
          • HaGeZi’s Samsung Tracker Blocklist
      2. Custom list
        • Go to Filters > DNS Blocklists > Add Blocklist: Add a custom list.
        • Name: Enter a name.
        • URL
          https://raw.githubusercontent.com/huffmanks/code-share/refs/heads/main/src/files/config/adguard/blocklist.txt

      • Go to Settings > General Settings.
        • Use AdGuard browsing security web service.
        • Use AdGuard parental control web service.
        • Use Safe Search.

      • Go to Settings > DNS settings.

        • Upstream DNS servers.

          https://dns.quad9.net/dns-query
          https://dns.cloudflare.com/dns-query
          https://dns.adguard-dns.com/dns-query
          • Enter the DNS providers above.
          • Click apply.

        • DNS server configuration.

          • Enable DNSSEC.
          • Click save.

        • Access Settings > Allowed clients.

          100.64.0.0/10
          {{SUBNET_VAR}}
          • Add Tailscale and device IP ranges above.
          • Leave blank to allow all.
          • Click Save configuration.

      • Go to Filters > Custom filtering rules.

        @@||tailscale.com^
        @@||tailscale.io^
        @@||log.tailscale.io^
        ||*.church^$denyallow=host.church|life.church|online.church,badfilter
        • Add domains to allow.
        • Click Apply.

  4. Access the administrative dashboard to route incoming traffic and manage SSL certificates for your services.

      • Go to http://localhost:81 or http://{{SERVER_IP_VAR}}:81
      • Go to Certificates > Add Certificate > Let’s Encrypt via DNS.
      • Domain Names: Enter *.lan.your-domain.tld.
      • DNS Provider: Select Cloudflare.
      • Credentials File Content: Replace dns_cloudflare_api_token=YOUR_CLOUDFLARE_API_KEY.
      • Agree to terms and click Save.

      • In NPM, go to Hosts > Proxy Hosts > Add Proxy Host.
      • Domain Names: adguard.lan.your-domain.tld.
      • Scheme: http.
      • Forward IP: {{SERVER_IP_VAR}}.
      • Forward Port: 8080.
      • Block common exploits and Websockets support: toggle to ON.
      • SSL Tab: Select the certificate you created.
      • Force SSL and HTTP/2 Support: toggle to ON.
      • Click Save.

  5. Update the Primary DNS, often located under LAN, DHCP or DNS Settings.

    • Primary DNS: {{SERVER_IP_VAR}} or {{VIRTUAL_IP_VAR}} (Your device’s Local LAN IP or virtual IP, not the Tailscale one).
    • Secondary DNS: 1.1.1.1 (Fail-safe so your internet still works if your device is turned off).