39 lines
942 B
Django/Jinja
39 lines
942 B
Django/Jinja
#jinja2: lstrip_blocks: True
|
|
# {{ ansible_managed }}
|
|
upstream backend_matrix {
|
|
server {{ matrix_bind_ip }}:{{ matrix_bind_port }};
|
|
}
|
|
|
|
server {
|
|
listen 80;
|
|
server_name {{ matrix_base_url | urlsplit('hostname') }};
|
|
|
|
client_max_body_size 200M;
|
|
|
|
{% if matrix_nginx_tls_enabled %}
|
|
return 301 https://$server_name$request_uri;
|
|
{% else %}
|
|
location / {
|
|
proxy_pass http://backend_matrix;
|
|
proxy_set_header X-Forwarded-For $remote_addr;
|
|
}
|
|
{% endif %}
|
|
}
|
|
|
|
{% if matrix_nginx_tls_enabled %}
|
|
server {
|
|
listen 443 ssl;
|
|
server_name {{ matrix_base_url | urlsplit('hostname') }};
|
|
|
|
client_max_body_size 200M;
|
|
|
|
location / {
|
|
proxy_pass http://backend_matrix;
|
|
proxy_set_header X-Forwarded-For $remote_addr;
|
|
}
|
|
|
|
ssl_certificate /etc/pki/tls/certs/{{ matrix_nginx_tls_cert_file }};
|
|
ssl_certificate_key /etc/pki/tls/private/{{ matrix_nginx_tls_key_file }};
|
|
}
|
|
{% endif %}
|