mirror of
https://git.lgmrszd.xyz/Lgmrszd/nix-cfg.git
synced 2024-11-25 20:38:54 +01:00
Simpler acme setup
This commit is contained in:
parent
248d4825c4
commit
fba9f555d3
1 changed files with 7 additions and 14 deletions
|
@ -39,10 +39,15 @@ in
|
||||||
|
|
||||||
services.nginx = {
|
services.nginx = {
|
||||||
enable = true;
|
enable = true;
|
||||||
virtualHosts.${gtnhDomain} = {
|
virtualHosts.${rootDomain} = {
|
||||||
# addSSL = true;
|
# addSSL = true;
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
# enableACME = true;
|
default = true;
|
||||||
|
enableACME = true;
|
||||||
|
root = "/var/www/todo";
|
||||||
|
};
|
||||||
|
virtualHosts.${gtnhDomain} = {
|
||||||
|
forceSSL = true;
|
||||||
useACMEHost = "${rootDomain}";
|
useACMEHost = "${rootDomain}";
|
||||||
root = "/var/www/gtnh";
|
root = "/var/www/gtnh";
|
||||||
};
|
};
|
||||||
|
@ -61,24 +66,12 @@ in
|
||||||
useACMEHost = "${rootDomain}";
|
useACMEHost = "${rootDomain}";
|
||||||
root = "/var/www/todo";
|
root = "/var/www/todo";
|
||||||
};
|
};
|
||||||
virtualHosts."acmechallenge.${rootDomain}" = {
|
|
||||||
# Catchall vhost, will redirect users to HTTPS for all vhosts
|
|
||||||
serverAliases = [ "*.${rootDomain}" ];
|
|
||||||
locations."/.well-known/acme-challenge" = {
|
|
||||||
root = "/var/lib/acme/.challenges";
|
|
||||||
};
|
|
||||||
locations."/" = {
|
|
||||||
return = "301 https://$host$request_uri";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
security.acme = {
|
security.acme = {
|
||||||
acceptTerms = true;
|
acceptTerms = true;
|
||||||
defaults.email = "lgmrszd@disroot.org";
|
defaults.email = "lgmrszd@disroot.org";
|
||||||
certs.${rootDomain} = {
|
certs.${rootDomain} = {
|
||||||
group = "nginx";
|
|
||||||
webroot = "/var/lib/acme/.challenges";
|
|
||||||
extraDomainNames = [
|
extraDomainNames = [
|
||||||
gtnhDomain
|
gtnhDomain
|
||||||
akkoDomain
|
akkoDomain
|
||||||
|
|
Loading…
Reference in a new issue