this post was submitted on 16 Jun 2023
17 points (100.0% liked)

Programming

13226 readers
1 users here now

All things programming and coding related. Subcommunity of Technology.


This community's icon was made by Aaron Schneider, under the CC-BY-NC-SA 4.0 license.

founded 1 year ago
MODERATORS
 

I've recently been wondering if Lemmy should switch out NGINX for Caddy, while I hadn't had experience with Caddy it looks like a great & fast alternative, What do you all think?

EDIT: I meant beehaw not Lemmy as a whole

you are viewing a single comment's thread
view the rest of the comments
[–] Illecors@lemmy.cafe 20 points 1 year ago (1 children)

Why? What's wrong with nginx?

[–] CinnamonTheCat@beehaw.org 2 points 1 year ago* (last edited 1 year ago) (3 children)

While I can't speak for others, I've found NGINX to have weird issues where sometimes it just dies. And I have to manually restart the systemd service.

The configuration files are verbose, and maybe caddy would have better performance? I hadn't investigated it much

EDIT:

Nginx lacks http3 support out of the box

[–] speff@melly.0x-ia.moe 8 points 1 year ago (1 children)

I'm running a lot of services off my nginx reverse proxy. This is my general setup for each subdomain - each in its own config file. I wouldn't consider this verbose in any way - and it's never crashed on me

service.conf

server {
    listen       443 ssl http2;
    listen  [::]:443 ssl http2;
    server_name  [something].0x-ia.moe;

    include /etc/nginx/acl_local.conf;
    include /etc/nginx/default_settings.conf;
    include /etc/nginx/ssl_0x-ia.conf;

    location / {
        proxy_pass              http://[host]:[port]/;
    }
}
[–] CinnamonTheCat@beehaw.org 1 points 1 year ago (1 children)
  1. there are hidden configs
  2. this adds up quickly for more complex scenarios
  3. Yeah, fair enough it is really a preference thing and caddy supports it
[–] speff@melly.0x-ia.moe 2 points 1 year ago (1 children)

The hidden configs are boilerplate which are easily imported for any applicable service. A set-once set of files isn't what I would count towards being verbose. 90% of my services use the exact same format.

If a certain service is complicated and needs more config in nginx, it's going to be the same for caddy.

[–] CinnamonTheCat@beehaw.org 1 points 1 year ago

The hidden configs are boilerplate which are easily imported for any applicable service. A set-once set of files isn’t what I would count towards being verbose. 90% of my services use the exact same format.

I don't know, I prefer it to be easier to set up my proxy especially when it comes to configs, each to their own I guess.

[–] Illecors@lemmy.cafe 3 points 1 year ago (1 children)

nginx was built for performace, so I doubt caddy would have any significant different in regards to that. I've not found config verbosity to be a problem for me, but I guess to each their own. I'm aware I may come across as some gatekeeper - I assure you that is not my intention. It just feels like replacing a perfectly working, battle testing service with another one just because it's newer is a bit of a waste of resources. Besides - you can do it yourself on your instance. It's just a load balancer in front of a docker image.

[–] CinnamonTheCat@beehaw.org 1 points 1 year ago (1 children)

Isn't caddy battle tested too? And looking into alternatives is not really a waste of resources. It just feels like nginx is not as reliable and likes to drop requests. It's not just a load balancer, mind you.

[–] Illecors@lemmy.cafe 2 points 1 year ago (1 children)

I am surprised you're getting dropped requests. What do the logs say?

[–] CinnamonTheCat@beehaw.org 1 points 1 year ago (1 children)

I mean not on my personal server, my personal server keeps dying all the time and I got tired of it. I haven't looked into the logs. But I meant with the recent influx of reddit users, I saw beehaw and lemmy.ml also have 500 errors.

[–] Illecors@lemmy.cafe 3 points 1 year ago (1 children)

Right. If you're getting a 500 (I suspect 502 - bad gateway) you're not dropping requests. That is lemmy itself crapping its pants. Nginx simply tells you the target behind it is doing something wrong. Happens when the lemmy software get overwhelmed.

[–] CinnamonTheCat@beehaw.org 1 points 1 year ago (1 children)

Oh, sorry I apologize I didn't know it was lemmy going dead.

[–] supernovae@readit.buzz 1 points 1 year ago (1 children)

http3 is available in nginx 1.25 if you want to run their current release.

[–] CinnamonTheCat@beehaw.org 1 points 1 year ago (1 children)

Oh, but is it by default enabled?

[–] supernovae@readit.buzz 1 points 1 year ago (1 children)

no idea, i run 1.24 - i do QUICK termination on CDN either Fastly or Cloudflare

[–] CinnamonTheCat@beehaw.org 1 points 1 year ago

If it's an option but not supported, well, uh? I don't think that's a good argument.