Why you should replace NGINX, it's time to upgrade.
-
@MooCloud_Matt Sorry that's not a useful comment without more relevant information.
When was this? V1/V2? What went terrible? What was the issue? What CDN?
https://caddy.community has plenty of examples of it working with, in front of and behind CDNs.
I've used it since V1 when needing to expose dirs of files with TLS.
With Cloudron 8.0 coming, it might be useful to rethink the stack a bit.
-
@robi Apache and nginx are still very well maintained and supported - and don't get me wrong, Caddy is really good, probably even better. and really im not even arguing against your point, really, more just putting in my 2 cents.
Apache and nginx are running a majority of the internet right now. And caddy is NOT a drop in replacement. Millions of software will need to be updated to make that change to Caddy. TBH I don't believe caddy should replace nginx in cloudron but maybe there can be an app for (or an option to switch to ) caddy. It certainly would not be difficult to make.
-
@robi
true,so let me give more context.
Yes, it was Caddy that was used in a beta product by a European CDN provider (I don't know if I can provide the name of it, but I'm sure I can give some results).
Caddy was highly inconsistent due to the garbage collector in Golang, which is amazingly good but don't scale well if you go outside his tagged usage (microservices and server-related task).
This causes spike in resource usage from the garbage collector.
So the positive side of being able to update a config with rest API doesn't compensate for the instability that Caddy has under load.You can't compare go to C or C++; they are just faster, memory management is up to you as a developer, and Nginx is amazingly good at it.
Go is born as a Java alternative, not C for that we have rust that don't have a mature webserver or proxy for what I know to compete with Nginx (openresty), Apache (that means LS too).
Cloudflare migrates from Nginx to OpenRegisty and now to a proprietary Proxy, but just for some small stuff, main proxy is still OR.
Should cloudron migrate to Caddy, maybe?
- list itemZeroSSL is really good and we extensively use it.
- api config by default is amazing
But then you still need Nginx for much other stuff like:
- Webserver PHP-FPM is still better supported in Nginx with better caching.
- Better support for Nginx from the PHP community. that means more requests in the forum( or our customer care) on how to use plugins for WordPress with Caddy.
-
@robi said in Why you should replace NGINX, it's time to upgrade.:
With Cloudron 8.0 coming, it might be useful to rethink the stack a bit.
I'm on the same page for that, but I would not change something that is working well and have stable support.
Even the performance advantages caddy and HTTP2/Quick could have are nothing compared to other parts of the stack that are not optimized for performance. So the bottleneck is not there.
-
@MooCloud_Matt While OpenResty - IS - Nginx at its core, it does a whole lot more. Even Nginx is more than what we use it for, like proxying IMAP/POP3, etc.
Regardless of what solution is looked at (doesn't have to be caddy), something needs to change so Cloudron is more usable within it's own services as well as others. Looking at it systematically should make the choices clear.
Discussion here or elsewhere in the open will make it more transparent and richer in diverse ideas.
-
@MooCloud_Matt said in Why you should replace NGINX, it's time to upgrade.:
for now, the limitation is related to what you can customize inside your cloudronmanifest.
Great, can you expand on that? What is the limitation? What would you like to see? How would we go about making that happen?
-
@robi
Such a big question, I already provided some of our ideas to the cloudron team, and we will see the future limits as soon as Cloudron moves to a more open AppStore.TLDR:
With the support for 3°party apps, developers will now containerize and maintain their apps by themselves, requiring less maintenance from the cloudron core team.
At that point with an open ecosystem we can expect deep optimization. -
Most tech stack decisions (by us, atleast) are not made based solely on technical details. The developer mindshare plays a big role. nginx/apache are known by practically anyone and problems are just easier to solve. Given this, one has to hit some unsurmountable technical problems before considering a switch. We are yet to hit any problems with nginx (for almost a decade now...).
Same applies for things like docker, nodejs, angular etc. I am sure there's things out there which are better these days but everyone knows these tools and any problems one hits are solvable. Unless these things go unmaintained or have severe technical issues, it's hard to justify replacing them.
Of course, such articles are still useful, because if one starts a project from scratch maybe we make different choices.
-
Speaking as a middle-of-the-road hobbyist, I've managed to figure out most Apache or NGINX problems, related to certs or virtual hosts, but caddy.... the one time I tried it out, because it was touted as a simple, easy to use, web host solution, man, I could not get more than one domain working. The tuts at the time (2 years ago thereabouts), and which ever forum I asked on, we just couldn't get that thing to work. I haven't bothered since, since the two alternatives really do just work.
-
Just tried out Caddy today! It is extremely easy!!!
I deployed Flowise with only two lines of caddyfile code.
flowise.riverhill.ai { # Use Cloudflare SSL certificates tls /etc/caddy/certs/cert.pem /etc/caddy/certs/key.pem # Reverse proxy to Flowise reverse_proxy localhost:3000 }
This really opened a whole new world for me!
I also tried Traefik, but I had to ask ChatGPT to add labels for me.
I don't really understand how those lables work...This is a great tutorial. Worth checking out.