Embed Notice
HTML Code
Corresponding Notice
- Embed this notice
destructatron (destructatron@masto.destructatron.net)'s status on Saturday, 02-Mar-2024 22:04:13 JSTdestructatron @aral @tommorris security.acme.acceptTerms = true;
security.acme.defaults.email = "email goes here";
services.nginx = {
enable = true;
virtualHosts = {
"destructatron.net" = {
forceSSL = true;
enableACME = true;
locations."/" = {
root = "/sites/main";
};
};
"code.destructatron.net" = {
forceSSL = true;
enableACME = true;
locations."/" = {
root = "/sites/code";
};
};
};
};
You can do certs via certbot, but the module is experimental and acme is the recommended option. We have 2 virtual hosts defined here, my main site and the code subdomain. The location is set to /, so where browsers go for index.html. The root is the absolute path to where the site's files are. The braces define blocks. If we didn't have these, we'd be doing services.nginx.virtualHosts.domain.locations.root for example, which is kind of annoying to keep writing out.