1
1
mirror of https://gitlab.archlinux.org/archlinux/infrastructure.git synced 2025-01-18 08:06:16 +01:00
infrastructure/roles/syncrepo/templates/nginx.d.conf.j2
Evangelos Foutras a48f4625b5
syncrepo: add X-Served-By header to geo mirrors
Potentially useful to quickly know which mirror we're talking to.
2022-04-16 16:07:59 +03:00

27 lines
850 B
Django/Jinja

{% for domain in mirror_domains %}
server {
listen 80;
listen [::]:80;
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name {{ domain }};
root /srv/ftp;
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;
include snippets/letsencrypt.conf;
ssl_certificate /etc/letsencrypt/live/{{ domain }}/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/{{ domain }}/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/{{ domain }}/chain.pem;
{% if 'geo_mirrors' in group_names and domain == geo_mirror_domain %}
add_header X-Served-By "{{ inventory_hostname }}";
{% endif %}
autoindex on;
}
{% endfor %}