I’ve been using Linux for decades, I’ve worked as a software engineer/architect/sre for around a decade, but networking has always been my biggest gap in knowledge.

I have a local server, I have caddy spun up, a glinet router running their version of openwrt, and I have a domain name purchased through porkbun.

I am looking to setup “local.domain.com” to point to my local server, ideally without exposing it publicly, and enable devices on my home network to be able to access it from that url. Id also like to be able to access containers running on that server by something like “searxng.local.domain.com” or “local.domain.com/searxng” aka without using the port suffix. Id also like to enable https.

I have read so many guides that have fragments of what I need, but nothing that ties enough together to get it working. And with all the options around different domain registers, let’s encrypt, reverse proxies, etc, im struggling just a bit.

Are their any guides (prefer text over YouTube, but beggars cant be choosers) that people recommend that encompass the whole process, instead of just pieces? Id like to understand it instead of just fumble through it.

  • I have AdGuard Home running on OPNSense as a local DNS with a wild card for for the ‘local domain’ pointing to Caddy

    in Caddy I have this section:

    *.<domain>.net {
    #header X-Frame-Options "SAMEORIGIN"
            tls internal
            encode gzip
            import sec-headers
            @sub1 host pve.<domain>.net
            @sub2 host kasm.<domain>.net
           ...
           handle @sub1 {
                    import sec-headers
                    reverse_proxy * https://10.1.1.11:8006/ {
                            transport http {
                                    tls_insecure_skip_verify
                            }
                    #       header_up Host {host}
                           header_up X-Real-IP {remote}
                           header_up X-Forwarded-For {remote}
                           header_up X-Forwarded-Port {server_port}
                           header_up X-Forwarded-Proto {scheme}
                    }
            }
            handle @sub2 {
                    import sec-headers
                    reverse_proxy  https://10.1.1.119/ {
                            transport http {
                                    tls_insecure_skip_verify
                            }
                    #       header_up Host {host}
                           header_up X-Real-IP {remote}
                           header_up X-Forwarded-For {remote}
                           header_up X-Forwarded-Port {server_port}
                           header_up X-Forwarded-Proto {scheme}
                    }
            }
    ...