2019-05-07 21:23:35 +02:00
|
|
|
#jinja2: lstrip_blocks: "True"
|
2019-08-07 11:53:53 +02:00
|
|
|
|
2021-01-25 09:21:17 +02:00
|
|
|
server {
|
|
|
|
listen 12080;
|
2021-11-05 15:31:10 +02:00
|
|
|
{% if matrix_nginx_proxy_enabled %}
|
|
|
|
server_name {{ matrix_nginx_proxy_proxy_synapse_hostname }};
|
|
|
|
{% endif %}
|
2019-05-08 20:49:51 +02:00
|
|
|
|
2021-01-25 09:21:17 +02:00
|
|
|
server_tokens off;
|
|
|
|
root /dev/null;
|
|
|
|
|
|
|
|
gzip on;
|
|
|
|
gzip_types text/plain application/json;
|
2019-05-08 20:49:51 +02:00
|
|
|
|
2021-01-25 09:21:17 +02:00
|
|
|
{% for configuration_block in matrix_nginx_proxy_proxy_synapse_additional_server_configuration_blocks %}
|
2019-01-17 13:32:46 +02:00
|
|
|
{{- configuration_block }}
|
|
|
|
{% endfor %}
|
2018-10-21 23:20:37 +02:00
|
|
|
|
2021-01-25 09:21:17 +02:00
|
|
|
{# Everything else just goes to the API server ##}
|
|
|
|
location / {
|
2019-05-29 07:32:06 +02:00
|
|
|
{% if matrix_nginx_proxy_enabled %}
|
|
|
|
{# Use the embedded DNS resolver in Docker containers to discover the service #}
|
2022-10-30 00:55:36 +02:00
|
|
|
resolver {{ matrix_nginx_proxy_http_level_resolver }} valid=5s;
|
2021-01-25 09:21:17 +02:00
|
|
|
set $backend "{{ matrix_nginx_proxy_proxy_synapse_client_api_addr_with_container }}";
|
2019-05-29 07:32:06 +02:00
|
|
|
proxy_pass http://$backend;
|
|
|
|
{% else %}
|
|
|
|
{# Generic configuration for use outside of our container setup #}
|
2021-01-25 09:21:17 +02:00
|
|
|
proxy_pass http://{{ matrix_nginx_proxy_proxy_synapse_client_api_addr_sans_container }};
|
2019-05-29 07:32:06 +02:00
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
proxy_set_header Host $host;
|
|
|
|
|
|
|
|
client_body_buffer_size 25M;
|
|
|
|
client_max_body_size {{ matrix_nginx_proxy_proxy_matrix_client_api_client_max_body_size_mb }}M;
|
|
|
|
proxy_max_temp_file_size 0;
|
|
|
|
}
|
2019-12-06 11:53:09 +02:00
|
|
|
}
|
|
|
|
|
2021-01-25 09:21:17 +02:00
|
|
|
{% if matrix_nginx_proxy_proxy_synapse_federation_api_enabled %}
|
2019-12-06 11:53:09 +02:00
|
|
|
server {
|
2021-01-25 09:21:17 +02:00
|
|
|
listen 12088;
|
2021-11-05 15:31:10 +02:00
|
|
|
{% if matrix_nginx_proxy_enabled %}
|
|
|
|
server_name {{ matrix_nginx_proxy_proxy_synapse_hostname }};
|
|
|
|
{% endif %}
|
2019-12-06 11:53:09 +02:00
|
|
|
|
|
|
|
server_tokens off;
|
|
|
|
|
|
|
|
root /dev/null;
|
|
|
|
|
|
|
|
gzip on;
|
|
|
|
gzip_types text/plain application/json;
|
|
|
|
|
2019-02-05 11:07:08 +02:00
|
|
|
location / {
|
|
|
|
{% if matrix_nginx_proxy_enabled %}
|
|
|
|
{# Use the embedded DNS resolver in Docker containers to discover the service #}
|
2022-10-30 00:55:36 +02:00
|
|
|
resolver {{ matrix_nginx_proxy_http_level_resolver }} valid=5s;
|
2021-01-25 09:21:17 +02:00
|
|
|
set $backend "{{ matrix_nginx_proxy_proxy_synapse_federation_api_addr_with_container }}";
|
2019-02-05 11:07:08 +02:00
|
|
|
proxy_pass http://$backend;
|
|
|
|
{% else %}
|
|
|
|
{# Generic configuration for use outside of our container setup #}
|
2021-01-25 09:21:17 +02:00
|
|
|
proxy_pass http://{{ matrix_nginx_proxy_proxy_synapse_federation_api_addr_sans_container }};
|
2019-02-05 11:07:08 +02:00
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
proxy_set_header Host $host;
|
|
|
|
|
|
|
|
client_body_buffer_size 25M;
|
|
|
|
client_max_body_size {{ matrix_nginx_proxy_proxy_matrix_federation_api_client_max_body_size_mb }}M;
|
|
|
|
proxy_max_temp_file_size 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{% endif %}
|