is it better to use subdomains or paths? - eviltoast

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?

  • Freeman@lemmy.pub
    link
    fedilink
    arrow-up
    2
    ·
    1 year ago

    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 can do this. The reality is it depends on the app.

    But ultimately I used both and pass them through a nginx proxy. The proxy listens for the SNI and passes traffic based on that.

    For example homeassistant doesn’t do well with paths. So it goes to ha.contoso.com.

    Miniflux does handle paths. So it uses contoso.com/rss.

    Plex needs a shitload of headers and paths so I use the default of contoso.com to pass to it along with /web.

    My photo albums use both. And something’s even a separate gTLD.

    But they all run through the same nginx box at the border.