I have a bunch of services running on my LAN, mostly from a single Debian machine. I access them at URLs like http://devicename.lan:portnumber. I would like to change to http://servicename.devicename.lan.

How it works now: The router (openwrt) sets a static IP per device and the port number is selected by the application or system unit running it.

What is the absolute simplest way to accomplish this? I don’t mind if it is managed by the router or by the server machine itself. Hoping for something that can be configured with a text file or web interface or other basic mathod.

These sevices are private, just for me and I have no plans to ever access them externally. I have so far avoided any certificates or SSL or other stuff. I don’t use docker and would rather not get into it right now. I like my domain name setup how it is with fake local domains.

Hoping this could be possible without making a whole project out of it.

  • stratself@lemdro.id
    link
    fedilink
    English
    arrow-up
    15
    ·
    20 hours ago

    Use Caddy on each device, with tls turned off. Basically

    http://service1.devicename.lan/ {
        tls off
        reverse_proxy localhost:8000
    }
    http://service2.devicename.lan/ {
        tls off
        reverse_proxy localhost:8096
    }
    
    • layzerjeyt@lemmy.dbzer0.comOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      19 hours ago

      A lot of people are recommending caddy.

      When you say “on each device” you mean this configuration would refer to the services running on that device right? Not that every client device needs to have this set up?

      All my web services use apache or lighttd. Do I use caddy just for this or do I have to figure out how to move each of them to use this web server?

      Also does it work for non-web services, like ssh or samba? (Which wasn’t in my original question, I only thought of it now.)

      • kossa@feddit.org
        link
        fedilink
        English
        arrow-up
        3
        ·
        17 hours ago

        Do I use caddy just for this or do I have to figure out how to move each of them to use this web server?

        No, your services stay basically untouched. They still need to deliver their content via a webserver. But instead of delivering it straight to your browser, they now pass it to your reverse proxy (caddy), which delivers it to you.

      • stratself@lemdro.id
        link
        fedilink
        English
        arrow-up
        3
        ·
        18 hours ago

        When you say “on each device” you mean this configuration would refer to the services running on that device right? Not that every client device needs to have this set up?

        The device that runs multiple services will set that up, yes. Not the client.

        All my web services use apache or lighttd. Do I use caddy just for this or do I have to figure out how to move each of them to use this web server?

        Apache and lighttpd can both do the same thing that Caddy does (multiplex many services via subdomain names on port 80). Caddy is just simpler and hence recommended.

        You can move all services to use Caddy, takes some learning but overall better. Alternatively, if you already set up apache/lighttpd for each of your services, you can put Caddy in front and do something like

        http://service1.devicename.lan/ {
            tls off
            reverse_proxy localhost:<port-that-apache-listens-on>
        }
        

        Also does it work for non-web services, like ssh or samba? (Which wasn’t in my original question, I only thought of it now.)

        No. Also, those should be running on their dedicated ports anyways