bundles/nginx: add option to not redirect domain aliases

This commit is contained in:
Franzi 2024-02-13 14:01:40 +01:00
parent 050931edf2
commit 698f203936
Signed by: kunsi
GPG key ID: 12E3D2136B818350
3 changed files with 7 additions and 1 deletions

View file

@ -22,7 +22,7 @@ server {
% endif
}
% if domain_aliases:
% if domain_aliases and force_domain:
server {
server_name ${' '.join(sorted(domain_aliases))};
@ -61,7 +61,11 @@ server {
% endif
server {
% if domain_aliases and not force_domain:
server_name ${domain} ${' '.join(sorted(domain_aliases))};
% else:
server_name ${domain};
% endif
root ${webroot if webroot else '/var/www/{}/'.format(vhost)};
index ${' '.join(index)};

View file

@ -81,6 +81,7 @@ def letsencrypt(metadata):
domains[domain] = config.get('domain_aliases', set())
vhosts[vhost] = {
'ssl': 'letsencrypt',
'force_domain': True,
}
return {

View file

@ -146,6 +146,7 @@ domain_aliases = [
"mta-sts.franzi.business",
"mta-sts.kunsmann.eu",
]
force_domain = false
[metadata.nginx.vhosts.redirector]
domain = "kunbox.net"