84 points · by tambourine_man · 8y ago · 61 comments
To your lager point, I think paying for software is and has been the norm in many places. So nothing new.
The point was that it was easy to install and get it running. Your point defeats the purpose of Caddy in the first place.
It would be much easier to:
1. `sudo apt-get install nginx-extras python-certbot-nginx`
2. Add simple config with 80 port of your website/reverse proxy.
3. `sudo certbot --nginx`
4. Do not worry that you will be sued by nginx for using it for commercial purposes.
Init scripts are included as well, both for FreeBSD, macOS and for a several different init systems used by various Linux distros. https://github.com/mholt/caddy/tree/master/dist/init
FreeBSD even has it in the ports collection, so you can install it using the package manager that is included with FreeBSD
doas pkg install caddy
Once installed on FreeBSD with the above command, create a configuration file in the Caddyfile
format in /usr/local/www/Caddyfile. Example Caddyfile: www.mysite.com {
root /var/www/com.mysite.www
}
mysite.com {
redir https://www.mysite.com{uri}
}
sub.mysite.com {
root /var/www/com.mysite.sub
gzip
log /var/log/com.mysite.sub/access.log
}
Provide an SSL certificate issuer email in your rc.conf. By
providing an email address you automatically agree to
letsencrypt.org's general terms and conditions: doas sysrc caddy_cert_email="your.email@example.org"
Enable caddy in your
rc.conf: doas sysrc caddy_enable="YES"
Start the server: doas service caddy start
> Do not worry that you will be sued by nginx for using it for commercial purposes.The source code of Caddy is distributed under the terms of the Apache 2.0 license.
> arguably much better
That's very arguable because Caddy is great at what it does. I think you should try it out before assuming it can't come close to nginx. Also older software also tends to be stuck with legacy cruft so project age isn't such a simple signal.
Specifically, the DNS RFCs define that, given no search domain, a relative hostname (e.g. google.com) is equivalent to its absolute hostname form (e.g. google.com.).
This is used in SSL validation as well, a certificate valid for one is valid for the other, and in reverse.
Every webserver SHOULD respond to both names identically, or redirect from one to the other.
Let's try that. https://news.ycombinator.com./ yup, works. https://www.nginx.com./ as well. In fact, nginx, Apache2, IIS, the Google Cloud load balancers, AWS's load balancers, every major site supports this.
The only http servers breaking the RFC for absolutely no reason are Caddy and Traefik.
And the issue has been closed as WONTFIX months ago.
Do you really want to use an http server that doesn't even consider following the RFCs? And pay for that?
Link to the issue for other users who, like me, were concerned by your post:
https://github.com/mholt/caddy/issues/1632
According to the author, the issue is that (a) there are two RFCs that contradict each other on this distinction, and (b) most browsers do not treat them as such for the purpose of their same-origin policies. So he thinks it's best not to enable this alternate URL by default since it's trivial to add it as another route if you want.
I don't know if he's right or wrong, nevertheless, this clearly isn't a dude that doesn't give a shit.
Also, the concerns over security the caddy developer make aren't clarified and probably don't exist.
No dot has 2 possible meanins and with dot has one _to the resolving application_. To the server resolving a virtual host there is only one for both.
The quote is:
"RFC 1034 says the two domains are the same, but RFC 3986 says they are not. I can't tell from the http spec whether the two Host values are equivalent or not."
I also had this issue whenever I did migrations between different web applications that used different URL structures. To preserve my sanity, I now do the redirects in the application level.
I predict nginx will get a lot of competition from servers and applications written in Rust. Until then, it's viable as a reverse proxy and serves static files really great.
I'm open to competition in the field, I'm not sure the competition will emerge as fast as people think (just like competition for other well-established software bricks in general).
On the Windows side of the world, I've found IIS to be decently user friendly to set up and administer.
Caddy looks promising and simpler. Might have to take a look this weekend.
Even if you do manage to screw up the config, just do 'nginx -s reload' - this verifies the syntax of the config and then attempts to apply it. If it is successfully applied, (e.g. dns is resolvable for listed upstreams, etc etc etc) then launches new worker processes, and then messages old worker processes running the old config to not accept any new requests (so all go to the new workers) and to shut down after finishing handling any existing requests. If it fails to apply, old workers stay up and keep running with the old config.
Just sayin'.
> Caddy obtains certificates for you automatically using Let's Encrypt.
Not sure why that is not stated front and centre. It's a good idea.
It might not mention the implementation details but the concept is what matters.
Just looks like it's capable of doing that which doesn't take much attention.
It doesn't matter where the backend points and you can use it to serve a docker container if you want, but that's different from the the host/frontend address you use.
1. Add a public A record (or host file) local.mydomain.tld to 127.0.0.1.
2. Host my dns with cloudflare (other providers have plugins too), and install the caddy plugin to do the dns challenge for certs.
3. Caddy can then get certs for local.mydomain.tld and serve them locally.
But seriously, how do you know what their site is? Perhaps they're serving a lot of static content out of memory and a fat pipe, in which case the web server would in fact be a bottleneck.
Also completely unfond of the license. "Caddy is amazing because it has 3 line config files!" So what? That's only appealing to people who are afraid of editing config files. Here's a harsh reality for the developers (who probably won't see this, ah well), but "config files" are not worth $25/mo or whatever the full scale commercial costs of this are. Do the developers think that their target audience are incapable of configuring traditional webservers?
Just because you pour your blood sweat and tears into a thing doesn't mean that thing is worth any money.