1
1
mirror of https://gitlab.archlinux.org/archlinux/infrastructure.git synced 2025-01-18 08:06:16 +01:00
infrastructure/roles/matrix/templates/nginx.d.conf.j2
Jan Alexander Steffens (heftig) 3fa35b7609
matrix: Update synapse to 0.18.0
Add federation_reader as a another worker.
2020-07-31 00:06:51 +02:00

56 lines
1.5 KiB
Django/Jinja

{% for name, config in matrix_nginx_config.items() %}
upstream matrix_{{ name }} {
server 127.0.0.1:{{ config.port }};
}
{% endfor %}
server {
listen 80;
listen [::]:80;
server_name {{ matrix_domain }};
access_log /var/log/nginx/{{ matrix_domain }}/access.log reduced;
error_log /var/log/nginx/{{ matrix_domain }}/error.log;
include snippets/letsencrypt.conf;
location / {
access_log off;
return 301 https://$server_name$request_uri;
}
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name {{ matrix_domain }};
access_log /var/log/nginx/{{ matrix_domain }}/access.log reduced;
error_log /var/log/nginx/{{ matrix_domain }}/error.log;
ssl_certificate /etc/letsencrypt/live/{{ matrix_domain }}/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/{{ matrix_domain }}/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/{{ matrix_domain }}/chain.pem;
{% for name, config in matrix_nginx_config.items() %}
# {{ name }}
{% for location in config.locations %}
location {{ location }} {
access_log /var/log/nginx/{{ matrix_domain }}/access.log main;
proxy_pass http://matrix_{{ name }};
proxy_set_header X-Forwarded-For $remote_addr;
proxy_read_timeout 900s;
}
{% endfor %}
{% endfor %}
location = / {
add_header Content-Type text/plain;
return 200 "Nothing to see here.";
}
location / {
return 404;
}
}