caddy: move to new domain
This commit is contained in:
@@ -61,6 +61,22 @@ in
|
||||
|
||||
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