Generalization and removal of legacy url
This commit is contained in:
parent
c15fab234d
commit
8bdec44465
25 changed files with 91 additions and 114 deletions
7
system/services/server/nginx/acme/default.nix
Normal file
7
system/services/server/nginx/acme/default.nix
Normal file
|
@ -0,0 +1,7 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
security.acme = lib.mkIf config.services.nginx.enable {
|
||||
acceptTerms = true;
|
||||
defaults.email = "contact@example.com";
|
||||
};
|
||||
}
|
17
system/services/server/nginx/default.nix
Normal file
17
system/services/server/nginx/default.nix
Normal file
|
@ -0,0 +1,17 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
imports = [ ./virtualhosts ];
|
||||
|
||||
services.nginx = {
|
||||
enable = config.system.server.enable;
|
||||
recommendedTlsSettings = true;
|
||||
recommendedOptimisation = true;
|
||||
recommendedGzipSettings = true;
|
||||
recommendedProxySettings = true;
|
||||
};
|
||||
|
||||
networking.firewall.allowedTCPPorts = [
|
||||
80
|
||||
443
|
||||
];
|
||||
}
|
6
system/services/server/nginx/virtualhosts/default.nix
Normal file
6
system/services/server/nginx/virtualhosts/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
./example
|
||||
];
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
services.nginx.virtualHosts = lib.mkIf config.system.server.enable {
|
||||
"www.example.com" = {
|
||||
enableACME = true;
|
||||
addSSL = true;
|
||||
default = true;
|
||||
root = "/var/www/landing-page";
|
||||
};
|
||||
"example.com" = {
|
||||
enableACME = true;
|
||||
addSSL = true;
|
||||
globalRedirect = "www.example.com";
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue