Files
Mark HegrebergandChristian Heusel 410f59cb5a apply http_redirect role to our nginx
these are all the systems that the new redirect snippet can be cleanly
applied to. there are a few others not included, that will need a more
manual approach:
 - gitlab (multiple domains)
 - mta.sts(multiple domains)
 - archweb(mutltiple domains, snippets)
 - buildbtw(dynamic dev domains)
 - redirects(different structure)
 - public html(multiple domains)
 - archweb maintenence(different structure)
 - maintenence(different structure)

some of these might be solvable by tweaking the snippet to accept
multiple domains. I'll look into this

Co-authored-by: Christian Heusel <christian@heusel.eu>
2026-03-04 00:52:19 +01:00

30 lines
921 B
Django/Jinja

include snippets/redirect-80.conf;
{% for config in mta_sts %}
{% set domain = "mta-sts." + config.domains | first %}
server {
include snippets/listen-443.conf;
server_name mta-sts.{{ config.domains | join(' mta-sts.') }};
access_log /var/log/nginx/{{ domain }}/access.log reduced;
access_log /var/log/nginx/{{ domain }}/access.log.json json_reduced;
error_log /var/log/nginx/{{ domain }}/error.log;
acme_certificate letsencrypt;
ssl_certificate $acme_certificate;
ssl_certificate_key $acme_certificate_key;
location = /.well-known/mta-sts.txt {
default_type text/plain;
# Remember to bump the MTA-STS id in tf-stage1/archlinux.tf
return 200 'version: STSv1\r\nmode: enforce\r\nmax_age: 2592000\r\nmx: {{ config.mx | join('\\r\\nmx: ')}}\r\n';
}
location / {
access_log off;
return 404;
}
}
{% endfor %}