I have a few selfhosted services, but I’m slowly adding more. Currently, they’re all in subdomains like linkding.sekoia.example etc. However, that adds DNS records to fetch and means more setup. Is there some reason I shouldn’t put all my services under a single subdomain with paths (using a reverse proxy), like selfhosted.sekoia.example/linkding?

  • TemperateFox@beehaw.org
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    1 year ago

    Everyone is saying subdomains so I’ll try to give a reason for paths. Using subdomains makes local access a bit harder. With paths you can use httpS://192etc/example, but if you use subdomains, how do you connect internally with https? Https://example.192etc won’t work as you can’t mix an ip address with domain resolution. You’ll have to use http://192etc:port. So no httpS for internal access. I got around this by hosting adguard as a local DNS and added an override so that my domain resolved to the local IP. But this won’t work if you’re connected to a VPN as it’ll capture your DNS requests, if you use paths you could exclude the IP from the VPN.

    Edit: not sure what you mean by “more setup”, you should be using a reverse proxy either way.

    • tkohhh@waveform.social
      link
      fedilink
      arrow-up
      1
      ·
      1 year ago

      If your router has NAT reflection, then the problem you describe is non existent. I use the same domain/protocol both inside and outside my network.

    • Sekoia@lemmy.blahaj.zoneOP
      link
      fedilink
      arrow-up
      0
      ·
      1 year ago

      Edit: not sure what you mean by “more setup”, you should be using a reverse proxy either way.

      I’m using cloudflare tunnels (because I don’t have a static IP and I’m behind a NAS, so I would need to port forward and stuff, which is annoying). For me specifically, that means I have to do a bit of admin on the cloudflare dashboard for every subdomain, whereas with paths I can just config the reverse proxy.

      • bratling@sh.itjust.works
        link
        fedilink
        arrow-up
        1
        ·
        1 year ago

        because I don’t have a static IP and I’m behind a NAS, so I would need to port forward and stuff, which is annoying

        This week I discovered that Porkbun DNS has a nice little API that makes it easy to update your DNS programmatically. I set up Quentin’s DDNS Updater https://github.com/qdm12/ddns-updater

        Setup is a little fiddly, as you have to write some JSON by hand, but once you’ve done that, it’s done and done. (Potential upside: You could use another tool to manage or integrate by just emitting a JSON file.) This effectively gets me dynamic DNS updates.