caddy: move to new domain
This commit is contained in:
@@ -45,7 +45,8 @@ rec {
|
|||||||
|
|
||||||
https = {
|
https = {
|
||||||
certs = services_dir + "/http_certs";
|
certs = services_dir + "/http_certs";
|
||||||
domain = "gardling.com";
|
domain = "sigkill.computer";
|
||||||
|
old_domain = "gardling.com"; # Redirect traffic from old domain
|
||||||
};
|
};
|
||||||
|
|
||||||
gitea = {
|
gitea = {
|
||||||
|
|||||||
@@ -61,6 +61,22 @@ in
|
|||||||
|
|
||||||
serverAliases = [ "www.${service_configs.https.domain}" ];
|
serverAliases = [ "www.${service_configs.https.domain}" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Redirect old domain (bare) to new domain
|
||||||
|
${service_configs.https.old_domain} = {
|
||||||
|
extraConfig = ''
|
||||||
|
redir https://${service_configs.https.domain}{uri} permanent
|
||||||
|
'';
|
||||||
|
serverAliases = [ "www.${service_configs.https.old_domain}" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
# Redirect old domain (wildcard subdomains) to new domain
|
||||||
|
"*.${service_configs.https.old_domain}" = {
|
||||||
|
extraConfig = ''
|
||||||
|
# {labels.2} extracts the subdomain from *.gardling.com
|
||||||
|
redir https://{labels.2}.${service_configs.https.domain}{uri} permanent
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user