When I first set up my web server I don’t think Caddy was really a sensible choice. It was still immature (The big “version 2” rewrite was in beta). But it’s about five years from when that happened, so I decided to give Caddy a try.

Wow! My config shrank to about 25% from what it was with Nginx. It’s also a lot less stuff to deal with, especially from a personal hosting perspective. As much as I like self-hosting, I’m not like “into” configuring web servers. Caddy made this very easy.

I thought the automatic HTTPS feature was overrated until I used it. The fact is it works effortlessly. I do not need to add paths to certificate files in my config anymore. That’s great. But what’s even better is I do not need to bother with my server notes to once again figure out how to correctly use Certbot when I want to create new certs for subdomains, since Caddy will do it automatically.

I’ve been annoyed with my Nginx config for a while, and kept wishing to find the motivation to streamline it. It started simple, but as I added things to it over the years the complexity in the config file blossomed. But the thing that tipped me over to trying Caddy was seeing the difference between the Nginx and Caddy configurations necessary for Jellyfin. Seriously. Look at what’s necessary for Nginx.

https://jellyfin.org/docs/general/networking/nginx/#https-config-example

In Caddy that became

jellyfin.example.com {
  reverse_proxy internal.jellyfin.host:8096
}

I thought no way this would work. But it did. First try. So, consider this a field report from a happy Caddy convert, and if you’re not using it yet for self-hosting maybe it can simplify things for you, too. It made me happy enough to write about it.

  • Xanza@lemm.ee
    link
    fedilink
    English
    arrow-up
    3
    ·
    edit-2
    16 hours ago

    I very highly recommend that you take the time and just switch. Caddy is simply fabulous. It’s designed to work (assuming it’s compiled with the module) with containers and use docker networks for routing. It makes it easy to spin up containers and directly reference the container names instead of remembering IP addresses and particularly comes in handy when your entire environment is containerized.

    You can pull the caddy image and run it in docker and as long as your environment is configured correctly you can simply reverse_proxy @container and you’re done. Caddy pulls all the relevant port information directly from the container API.

    I get such a nerd boner thinking about it.

    • harsh3466@lemmy.ml
      link
      fedilink
      arrow-up
      1
      ·
      4 hours ago

      That’s really nice. Dang. I’m going to take a serious look at caddy. NPM has been working without issues lately, but I’m not looking forward to the next time it breaks on me.