I’m trying to set up a domain to more easily access my services on my home network, using a vanity URL instead of IP:port. With my current setup, my browser is not able to see the server (‘we can’t connect to the server’ at e.g. plex.mydomain.xyz).

I registered the domain through Cloudflare. In Cloudflare, I set up my DNS records (A - mydomain.xyz - content = 192.168.x.x; A - www; CNAME - *), and got my API token. Nginx is running in Docker (as are the services I am trying to access), using the jc21 container and their docker compose template. I used the API token to generate an SSL certificate in NPM with *.mydomain.xyz as the domain, then added a proxy host using the URL mentioned above as the Domain Name, the IP of the server that’s running all my containers for the forward hostname/IP, and the appropriate port for forward port. Then in the SSL tab told it to force SSL and HTTP/2.

I’m not sure what I’m doing incorrectly, the only thing I have running that might interfere with the network service is a PiHole, and it appears to be sending the request on. Also tried using localhost (127.0.0.1) to no avail. I’ve seen some others say they had to restart NPM a few times, so I’ve tried that as well. Thanks for any help!

*Edit: My router had DNS rebind protection enabled which was blocking the local address. I discovered this by using NSLOOKUP on my home network, where I got a ‘No internal type for both IPv4…’ error (in Windows command prompt) and outside my home network, where it resolved correctly. Thanks to those who commented, appreciate your time.

  • pirateMonkey@lemmy.worldOP
    link
    fedilink
    English
    arrow-up
    1
    ·
    10 days ago

    Yeah, just looking for internal access right now so I don’t have to remember the correct port for every service. Will use a VPN (leaning toward Tailscale) for remote access once I get this set up.

    • marsara9@lemmy.world
      link
      fedilink
      English
      arrow-up
      1
      ·
      edit-2
      10 days ago

      Are you able to query to see what IP address that domain returns? Does it return the 192.168.x address that you set?

      Edit: But the idea is to first see where the connection is failing… first see what error your browser is returning? 5xx? 4xx? This can be an indication as to where the error is happening. But high-level check DNS first, see if nslookup or dig return the IP address that you set. (Remember changes to DNS entries can take time to propagate). Assuming all of that is correct, then check to see what nginx is showing in its logs. Do you see it logging anything every time you try and access it via the domain name? Next up is checking the logs from plex itself, does it show any logs coming though? etc… But the idea is to find where the connection is breaking down.

      • pirateMonkey@lemmy.worldOP
        link
        fedilink
        English
        arrow-up
        1
        ·
        edit-2
        10 days ago

        Thanks for that flow on how to troubleshoot.

        When I try nslookup on the server, it doesn’t seem to be working at all (nslookup google.com returns ** server can’t find nslookup: NXDOMAIN). On Windows, it doesn’t return any IP (*** No internal type for both IPv4 and IPv6 Addresses records available). Looking at my Pi-hole query log, I do see that address was queried and allowed. *ETA - I do notice that the Windows nslookup returns a URL for Server and my router’s IP address for Address, while Linux returns the router’s IP address for Server and that address with #53 appended for Address.

        How can I check what Cloudflare is seeing (because as I understand that’s the next link in the chain)? I’m not seeing any logs there, but only created my account Saturday… *edit to add it’s obviously in the link in the sidebar that says analytics and logs, but not seeing any activity on any of those, so it seems to not be getting past the Pi-hole?

        • siph@feddit.org
          link
          fedilink
          English
          arrow-up
          2
          ·
          9 days ago

          You could try just using the ping or host commands, they will also try to resolve the domain.

          Also can you access the services by using IP:Port?