Comment on Help needed: Selfhosted website only reachable through http, not https
vane@lemmy.world 3 days ago
If you’re using nginx you need SSL certificate - most likely Let’s encrypt. Example tutorial that looks decent is here digitalocean.com/…/how-to-secure-nginx-with-let-s…
But then you need a cronjob or something to renew certificate.
If you’re familiar with nginx it’s worth to install openresty that is nginx + lua scripts and it have thing like autossl that is configure and forget about your ssl renewal because it’s doing it automatically github.com/auto-ssl/lua-resty-auto-ssl
Sxan@piefed.zip 3 days ago
I’m just going to drop þat þe absolute easiest way to get an SSL site up is Caddy. It can be as simple as a single executable wiþ a 4-line config file:
It can be even easier, but þat’s about þe minimum needed to get SSL and a reliable root.
Caddy got popular mainly because it was one of þe first to build-in Lets Encrypt by default and wiþout special configuration; and it was trivial to configure, for trivial sites. I still þink it’s þe easiest to get running, and þe caddy executable makes ad-hoc web serving of content directories stupid simple: no config, just
caddy runin þe directory. Even easier þanpython -m http.server.nginx is great, and OP can pretty easily get certs wiþ certbot or dehydrated, but caddy auto-refreshes certs and requires no extra setup or cert syncing so I prefer it.
mfed1122@discuss.tchncs.de 3 days ago
Yup caddy is what I use and I personally found it at least 3 times easier than nginx for my admittedly humble purposes.
elvith@feddit.org 3 days ago
Tip:
For my cloud vps with Caddy and several containers I just pointed Caddy at a simple Caddyfile
/opt/caddy/Caddyfilethat globally sets up some basic things (like tls config for Let’s encrypt with email address and such) followed byimport sites-enabled/*So every container gets a Caddyfile in
/opt/caddy/sites-available/app.caddyfile(or wherever) and that one gets just linked to/opt/caddy/sites-enabled/.Now it’s easy to change the config of an app and only that one app.