1
1
Fork 0

Refactor nginx vhosts and add wedding subdomain

This commit is contained in:
Jaculabilis 2023-01-10 17:43:25 +00:00
parent be2617aaf8
commit d1bd491141
1 changed files with 15 additions and 28 deletions

View File

@ -64,38 +64,25 @@
]; ];
environment.variables.EDITOR = "vim"; environment.variables.EDITOR = "vim";
services.nginx = { services.nginx = let
static-site = srv-dir: {
enableACME = true;
forceSSL = true;
root = "/srv/${srv-dir}/";
extraConfig = ''
access_log /var/log/nginx/access_${srv-dir}.log;
index index.html;
'';
};
in {
enable = true; enable = true;
recommendedProxySettings = true; recommendedProxySettings = true;
virtualHosts = { virtualHosts = {
# Static pages # Static pages
"www.ktvb.site" = { "wedding.ktvb.site" = static-site "wedding.ktvb.site";
enableACME = true; "www.ktvb.site" = static-site "www.ktvb.site";
forceSSL = true; "mirror.alogoulogoi.com" = static-site "mirror.alogoulogoi.com";
root = "/srv/wedding/"; "www.alogoulogoi.com" = static-site "www";
extraConfig = ''
access_log /var/log/nginx/access.ktvb.log;
index index.html;
'';
};
"mirror.alogoulogoi.com" = {
enableACME = true;
forceSSL = true;
root = "/srv/mirror.alogoulogoi.com";
extraConfig = ''
access_log /var/log/nginx/access.mirror.log;
index index.html;
'';
};
"www.alogoulogoi.com" = {
enableACME = true;
forceSSL = true;
root = "/srv/www/";
extraConfig = ''
access_log /var/log/nginx/access.www.log;
index index.html;
'';
};
# Deny all other subdomains # Deny all other subdomains
"alogoulogoi.com" = { "alogoulogoi.com" = {
default = true; default = true;