Matrix Docker Ansible eploy
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 

478 lignes
19 KiB

  1. #jinja2: lstrip_blocks: "True"
  2. {% macro render_nginx_status_location_block(addresses) %}
  3. {# Empty first line to make indentation prettier. #}
  4. location /nginx_status {
  5. stub_status on;
  6. access_log off;
  7. {% for address in addresses %}
  8. allow {{ address }};
  9. {% endfor %}
  10. deny all;
  11. }
  12. {% endmacro %}
  13. {% macro render_vhost_directives() %}
  14. gzip on;
  15. gzip_types text/plain application/json;
  16. {% if matrix_nginx_proxy_floc_optout_enabled %}
  17. add_header Permissions-Policy interest-cohort=() always;
  18. {% endif %}
  19. {% if matrix_nginx_proxy_hsts_preload_enabled %}
  20. add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
  21. {% else %}
  22. add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
  23. {% endif %}
  24. add_header X-XSS-Protection "{{ matrix_nginx_proxy_xss_protection }}";
  25. {% if matrix_nginx_proxy_proxy_matrix_nginx_status_enabled %}
  26. {{ render_nginx_status_location_block(matrix_nginx_proxy_proxy_matrix_nginx_status_allowed_addresses) }}
  27. {% endif %}
  28. {% if matrix_nginx_proxy_proxy_matrix_corporal_api_enabled %}
  29. location ^~ /_matrix/corporal {
  30. {% if matrix_nginx_proxy_enabled %}
  31. {# Use the embedded DNS resolver in Docker containers to discover the service #}
  32. resolver {{ matrix_nginx_proxy_http_level_resolver }} valid=5s;
  33. set $backend "{{ matrix_nginx_proxy_proxy_matrix_corporal_api_addr_with_container }}";
  34. proxy_pass http://$backend;
  35. {% else %}
  36. {# Generic configuration for use outside of our container setup #}
  37. proxy_pass http://{{ matrix_nginx_proxy_proxy_matrix_corporal_api_addr_sans_container }};
  38. {% endif %}
  39. proxy_set_header Host $host;
  40. proxy_set_header X-Forwarded-For {{ matrix_nginx_proxy_x_forwarded_for }};
  41. proxy_set_header X-Forwarded-Proto {{ matrix_nginx_proxy_x_forwarded_proto_value }};
  42. }
  43. {% endif %}
  44. {% if matrix_nginx_proxy_proxy_matrix_identity_api_enabled %}
  45. location ^~ /_matrix/identity {
  46. {% if matrix_nginx_proxy_enabled %}
  47. {# Use the embedded DNS resolver in Docker containers to discover the service #}
  48. resolver {{ matrix_nginx_proxy_http_level_resolver }} valid=5s;
  49. set $backend "{{ matrix_nginx_proxy_proxy_matrix_identity_api_addr_with_container }}";
  50. proxy_pass http://$backend;
  51. {% else %}
  52. {# Generic configuration for use outside of our container setup #}
  53. proxy_pass http://{{ matrix_nginx_proxy_proxy_matrix_identity_api_addr_sans_container }};
  54. {% endif %}
  55. proxy_set_header Host $host;
  56. proxy_set_header X-Forwarded-For {{ matrix_nginx_proxy_x_forwarded_for }};
  57. proxy_set_header X-Forwarded-Proto {{ matrix_nginx_proxy_x_forwarded_proto_value }};
  58. }
  59. {% endif %}
  60. {% if matrix_nginx_proxy_proxy_media_repo_enabled %}
  61. # Redirect all media endpoints to the media-repo
  62. location ^~ /_matrix/media {
  63. {% if matrix_nginx_proxy_enabled %}
  64. {# Use the embedded DNS resolver in Docker containers to discover the service #}
  65. resolver {{ matrix_nginx_proxy_http_level_resolver }} valid=5s;
  66. set $backend "{{ matrix_nginx_proxy_proxy_media_repo_addr_with_container }}";
  67. proxy_pass http://$backend;
  68. {% else %}
  69. {# Generic configuration for use outside of our container setup #}
  70. proxy_pass http://{{ matrix_nginx_proxy_proxy_media_repo_addr_sans_container }};
  71. {% endif %}
  72. # Make sure this matches your homeserver in media-repo.yaml
  73. # You may have to manually specify it if using delegation or the
  74. # incoming Host doesn't match.
  75. proxy_set_header Host {{ matrix_domain }};
  76. proxy_set_header X-Real-IP $remote_addr;
  77. proxy_set_header X-Forwarded-For $remote_addr;
  78. client_body_buffer_size {{ ((matrix_media_repo_max_bytes | int) / 4) | int }};
  79. client_max_body_size {{ matrix_media_repo_max_bytes }};
  80. }
  81. # Redirect other endpoints registered by the media-repo to its container
  82. # /_matrix/client/r0/logout
  83. # /_matrix/client/r0/logout/all
  84. location ~ ^/_matrix/client/(r0|v1|v3|unstable)/(logout|logout/all) {
  85. {% if matrix_nginx_proxy_enabled %}
  86. {# Use the embedded DNS resolver in Docker containers to discover the service #}
  87. resolver {{ matrix_nginx_proxy_http_level_resolver }} valid=5s;
  88. set $backend "{{ matrix_nginx_proxy_proxy_media_repo_addr_with_container }}";
  89. proxy_pass http://$backend;
  90. {% else %}
  91. {# Generic configuration for use outside of our container setup #}
  92. proxy_pass http://{{ matrix_nginx_proxy_proxy_media_repo_addr_sans_container }};
  93. {% endif %}
  94. # Make sure this matches your homeserver in media-repo.yaml
  95. # You may have to manually specify it if using delegation or the
  96. # incoming Host doesn't match.
  97. proxy_set_header Host {{ matrix_domain }};
  98. proxy_set_header X-Real-IP $remote_addr;
  99. proxy_set_header X-Forwarded-For $remote_addr;
  100. }
  101. # Redirect other endpoints registered by the media-repo to its container
  102. # /_matrix/client/r0/admin/purge_media_cache
  103. # /_matrix/client/r0/admin/quarantine_media/{roomId:[^/]+}
  104. location ~ ^/_matrix/client/(r0|v1|v3|unstable)/admin/(purge_media_cache|quarantine_media/.*) {
  105. {% if matrix_nginx_proxy_enabled %}
  106. {# Use the embedded DNS resolver in Docker containers to discover the service #}
  107. resolver {{ matrix_nginx_proxy_http_level_resolver }} valid=5s;
  108. set $backend "{{ matrix_nginx_proxy_proxy_media_repo_addr_with_container }}";
  109. proxy_pass http://$backend;
  110. {% else %}
  111. {# Generic configuration for use outside of our container setup #}
  112. proxy_pass http://{{ matrix_nginx_proxy_proxy_media_repo_addr_sans_container }};
  113. {% endif %}
  114. # Make sure this matches your homeserver in media-repo.yaml
  115. # You may have to manually specify it if using delegation or the
  116. # incoming Host doesn't match.
  117. proxy_set_header Host {{ matrix_domain }};
  118. proxy_set_header X-Real-IP $remote_addr;
  119. proxy_set_header X-Forwarded-For $remote_addr;
  120. }
  121. # Redirect other endpoints registered by the media-repo to its container
  122. location ^~ /_matrix/client/unstable/io.t2bot.media {
  123. {% if matrix_nginx_proxy_enabled %}
  124. {# Use the embedded DNS resolver in Docker containers to discover the service #}
  125. resolver {{ matrix_nginx_proxy_http_level_resolver }} valid=5s;
  126. set $backend "{{ matrix_nginx_proxy_proxy_media_repo_addr_with_container }}";
  127. proxy_pass http://$backend;
  128. {% else %}
  129. {# Generic configuration for use outside of our container setup #}
  130. proxy_pass http://{{ matrix_nginx_proxy_proxy_media_repo_addr_sans_container }};
  131. {% endif %}
  132. # Make sure this matches your homeserver in media-repo.yaml
  133. # You may have to manually specify it if using delegation or the
  134. # incoming Host doesn't match.
  135. proxy_set_header Host {{ matrix_domain }};
  136. proxy_set_header X-Real-IP $remote_addr;
  137. proxy_set_header X-Forwarded-For $remote_addr;
  138. }
  139. {% endif %}
  140. {% if matrix_nginx_proxy_proxy_matrix_user_directory_search_enabled %}
  141. location ~ ^/_matrix/client/(r0|v3)/user_directory/search {
  142. {% if matrix_nginx_proxy_enabled %}
  143. {# Use the embedded DNS resolver in Docker containers to discover the service #}
  144. resolver {{ matrix_nginx_proxy_http_level_resolver }} valid=5s;
  145. set $backend "{{ matrix_nginx_proxy_proxy_matrix_user_directory_search_addr_with_container }}";
  146. {% if matrix_nginx_proxy_proxy_matrix_user_directory_search_v3_to_r0_redirect_enabled %}
  147. rewrite ^(.*?)/v3/(.*?)$ $1/r0/$2 break;
  148. {% endif %}
  149. proxy_pass http://$backend;
  150. {% else %}
  151. {% if matrix_nginx_proxy_proxy_matrix_user_directory_search_v3_to_r0_redirect_enabled %}
  152. rewrite ^(.*?)/v3/(.*?)$ $1/r0/$2 break;
  153. {% endif %}
  154. {# Generic configuration for use outside of our container setup #}
  155. proxy_pass http://{{ matrix_nginx_proxy_proxy_matrix_user_directory_search_addr_sans_container }};
  156. {% endif %}
  157. proxy_set_header Host $host;
  158. proxy_set_header X-Forwarded-For {{ matrix_nginx_proxy_x_forwarded_for }};
  159. }
  160. {% endif %}
  161. {% if matrix_nginx_proxy_proxy_matrix_3pid_registration_enabled %}
  162. location ~ ^/_matrix/client/(r0|v3)/register/(email|msisdn)/requestToken$ {
  163. {% if matrix_nginx_proxy_enabled %}
  164. {# Use the embedded DNS resolver in Docker containers to discover the service #}
  165. resolver {{ matrix_nginx_proxy_http_level_resolver }} valid=5s;
  166. set $backend "{{ matrix_nginx_proxy_proxy_matrix_3pid_registration_addr_with_container }}";
  167. {% if matrix_nginx_proxy_proxy_matrix_3pid_registration_v3_to_r0_redirect_enabled %}
  168. rewrite ^(.*?)/v3/(.*?)$ $1/r0/$2 break;
  169. {% endif %}
  170. proxy_pass http://$backend;
  171. {% else %}
  172. {% if matrix_nginx_proxy_proxy_matrix_3pid_registration_v3_to_r0_redirect_enabled %}
  173. rewrite ^(.*?)/v3/(.*?)$ $1/r0/$2 break;
  174. {% endif %}
  175. {# Generic configuration for use outside of our container setup #}
  176. proxy_pass http://{{ matrix_nginx_proxy_proxy_matrix_3pid_registration_addr_sans_container }};
  177. {% endif %}
  178. proxy_set_header Host $host;
  179. proxy_set_header X-Forwarded-For {{ matrix_nginx_proxy_x_forwarded_for }};
  180. proxy_set_header X-Forwarded-Proto {{ matrix_nginx_proxy_x_forwarded_proto_value }};
  181. }
  182. {% endif %}
  183. {% for configuration_block in matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks %}
  184. {{- configuration_block }}
  185. {% endfor %}
  186. {#
  187. This handles the Matrix Client API only.
  188. The Matrix Federation API is handled by a separate vhost.
  189. #}
  190. location ~* ^({{ matrix_nginx_proxy_proxy_matrix_client_api_forwarded_location_prefix_regexes|join('|') }}) {
  191. {% if matrix_nginx_proxy_enabled %}
  192. {# Use the embedded DNS resolver in Docker containers to discover the service #}
  193. resolver {{ matrix_nginx_proxy_http_level_resolver }} valid=5s;
  194. set $backend "{{ matrix_nginx_proxy_proxy_matrix_client_api_addr_with_container }}";
  195. proxy_pass http://$backend;
  196. {% else %}
  197. {# Generic configuration for use outside of our container setup #}
  198. proxy_pass http://{{ matrix_nginx_proxy_proxy_matrix_client_api_addr_sans_container }};
  199. {% endif %}
  200. proxy_set_header Host $host;
  201. proxy_set_header X-Forwarded-For {{ matrix_nginx_proxy_x_forwarded_for }};
  202. proxy_set_header X-Forwarded-Proto {{ matrix_nginx_proxy_x_forwarded_proto_value }};
  203. client_body_buffer_size 25M;
  204. client_max_body_size {{ matrix_nginx_proxy_proxy_matrix_client_api_client_max_body_size_mb }}M;
  205. proxy_max_temp_file_size 0;
  206. }
  207. {#
  208. We only handle the root URI for this redirect or homepage serving.
  209. Unhandled URIs (mostly by `matrix_nginx_proxy_proxy_matrix_client_api_forwarded_location_prefix_regexes` above) should result in a 404,
  210. instead of causing a redirect.
  211. See: https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/1058
  212. #}
  213. location ~* ^/$ {
  214. rewrite ^/$ /_matrix/static/ last;
  215. }
  216. {% endmacro %}
  217. server {
  218. listen {{ 8080 if matrix_nginx_proxy_enabled else 80 }};
  219. listen [::]:{{ 8080 if matrix_nginx_proxy_enabled else 80 }};
  220. server_name {{ matrix_nginx_proxy_proxy_matrix_hostname }};
  221. server_tokens off;
  222. root /dev/null;
  223. {% if matrix_nginx_proxy_https_enabled %}
  224. location /.well-known/acme-challenge {
  225. {% if matrix_nginx_proxy_enabled %}
  226. {# Use the embedded DNS resolver in Docker containers to discover the service #}
  227. resolver {{ matrix_nginx_proxy_http_level_resolver }} valid=5s;
  228. set $backend "matrix-certbot:8080";
  229. proxy_pass http://$backend;
  230. {% else %}
  231. {# Generic configuration for use outside of our container setup #}
  232. proxy_pass http://127.0.0.1:{{ matrix_ssl_lets_encrypt_certbot_standalone_http_port }};
  233. {% endif %}
  234. }
  235. {% if matrix_nginx_proxy_proxy_matrix_nginx_status_enabled %}
  236. {{ render_nginx_status_location_block(matrix_nginx_proxy_proxy_matrix_nginx_status_allowed_addresses) }}
  237. {% endif %}
  238. location / {
  239. return 301 https://$http_host$request_uri;
  240. }
  241. {% else %}
  242. {{ render_vhost_directives() }}
  243. {% endif %}
  244. }
  245. {% if matrix_nginx_proxy_https_enabled %}
  246. server {
  247. listen {{ 8443 if matrix_nginx_proxy_enabled else 443 }} ssl http2;
  248. listen [::]:{{ 8443 if matrix_nginx_proxy_enabled else 443 }} ssl http2;
  249. server_name {{ matrix_nginx_proxy_proxy_matrix_hostname }};
  250. server_tokens off;
  251. root /dev/null;
  252. ssl_certificate {{ matrix_ssl_config_dir_path }}/live/{{ matrix_nginx_proxy_proxy_matrix_hostname }}/fullchain.pem;
  253. ssl_certificate_key {{ matrix_ssl_config_dir_path }}/live/{{ matrix_nginx_proxy_proxy_matrix_hostname }}/privkey.pem;
  254. ssl_protocols {{ matrix_nginx_proxy_ssl_protocols }};
  255. {% if matrix_nginx_proxy_ssl_ciphers != '' %}
  256. ssl_ciphers {{ matrix_nginx_proxy_ssl_ciphers }};
  257. {% endif %}
  258. ssl_prefer_server_ciphers {{ matrix_nginx_proxy_ssl_prefer_server_ciphers }};
  259. {% if matrix_nginx_proxy_ocsp_stapling_enabled %}
  260. ssl_stapling on;
  261. ssl_stapling_verify on;
  262. ssl_trusted_certificate {{ matrix_ssl_config_dir_path }}/live/{{ matrix_nginx_proxy_proxy_matrix_hostname }}/chain.pem;
  263. {% endif %}
  264. {% if matrix_nginx_proxy_ssl_session_tickets_off %}
  265. ssl_session_tickets off;
  266. {% endif %}
  267. ssl_session_cache {{ matrix_nginx_proxy_ssl_session_cache }};
  268. ssl_session_timeout {{ matrix_nginx_proxy_ssl_session_timeout }};
  269. {{ render_vhost_directives() }}
  270. }
  271. {% endif %}
  272. {% if matrix_nginx_proxy_proxy_matrix_federation_api_enabled %}
  273. {#
  274. This federation vhost is a little special.
  275. It serves federation over HTTP or HTTPS, depending on `matrix_nginx_proxy_https_enabled`.
  276. #}
  277. server {
  278. {% if matrix_nginx_proxy_https_enabled %}
  279. listen {{ matrix_nginx_proxy_proxy_matrix_federation_port }} ssl http2;
  280. listen [::]:{{ matrix_nginx_proxy_proxy_matrix_federation_port }} ssl http2;
  281. {% else %}
  282. listen {{ matrix_nginx_proxy_proxy_matrix_federation_port }};
  283. {% endif %}
  284. server_name {{ matrix_nginx_proxy_proxy_matrix_federation_hostname }};
  285. server_tokens off;
  286. root /dev/null;
  287. gzip on;
  288. gzip_types text/plain application/json;
  289. {% if matrix_nginx_proxy_https_enabled %}
  290. ssl_certificate {{ matrix_nginx_proxy_proxy_matrix_federation_api_ssl_certificate }};
  291. ssl_certificate_key {{ matrix_nginx_proxy_proxy_matrix_federation_api_ssl_certificate_key }};
  292. ssl_protocols {{ matrix_nginx_proxy_ssl_protocols }};
  293. {% if matrix_nginx_proxy_ssl_ciphers != '' %}
  294. ssl_ciphers {{ matrix_nginx_proxy_ssl_ciphers }};
  295. {% endif %}
  296. ssl_prefer_server_ciphers {{ matrix_nginx_proxy_ssl_prefer_server_ciphers }};
  297. {% if matrix_nginx_proxy_ocsp_stapling_enabled %}
  298. ssl_stapling on;
  299. ssl_stapling_verify on;
  300. ssl_trusted_certificate {{ matrix_nginx_proxy_proxy_matrix_federation_api_ssl_trusted_certificate }};
  301. {% endif %}
  302. {% if matrix_nginx_proxy_ssl_session_tickets_off %}
  303. ssl_session_tickets off;
  304. {% endif %}
  305. ssl_session_cache {{ matrix_nginx_proxy_ssl_session_cache }};
  306. ssl_session_timeout {{ matrix_nginx_proxy_ssl_session_timeout }};
  307. {% endif %}
  308. {% if matrix_nginx_proxy_proxy_media_repo_enabled %}
  309. # Redirect all media endpoints to the media-repo
  310. location ^~ /_matrix/media {
  311. {% if matrix_nginx_proxy_enabled %}
  312. {# Use the embedded DNS resolver in Docker containers to discover the service #}
  313. resolver {{ matrix_nginx_proxy_http_level_resolver }} valid=5s;
  314. set $backend "{{ matrix_nginx_proxy_proxy_media_repo_addr_with_container }}";
  315. proxy_pass http://$backend;
  316. {% else %}
  317. {# Generic configuration for use outside of our container setup #}
  318. proxy_pass http://{{ matrix_nginx_proxy_proxy_media_repo_addr_sans_container }};
  319. {% endif %}
  320. # Make sure this matches your homeserver in media-repo.yaml
  321. # You may have to manually specify it if using delegation or the
  322. # incoming Host doesn't match.
  323. proxy_set_header Host {{ matrix_domain }};
  324. proxy_set_header X-Real-IP $remote_addr;
  325. proxy_set_header X-Forwarded-For $remote_addr;
  326. client_body_buffer_size {{ ((matrix_media_repo_max_bytes | int) / 4) | int }};
  327. client_max_body_size {{ matrix_media_repo_max_bytes }};
  328. }
  329. # Redirect other endpoints registered by the media-repo to its container
  330. # /_matrix/client/r0/logout
  331. # /_matrix/client/r0/logout/all
  332. location ~ ^/_matrix/client/(r0|v1|v3|unstable)/(logout|logout/all) {
  333. {% if matrix_nginx_proxy_enabled %}
  334. {# Use the embedded DNS resolver in Docker containers to discover the service #}
  335. resolver {{ matrix_nginx_proxy_http_level_resolver }} valid=5s;
  336. set $backend "{{ matrix_nginx_proxy_proxy_media_repo_addr_with_container }}";
  337. proxy_pass http://$backend;
  338. {% else %}
  339. {# Generic configuration for use outside of our container setup #}
  340. proxy_pass http://{{ matrix_nginx_proxy_proxy_media_repo_addr_sans_container }};
  341. {% endif %}
  342. # Make sure this matches your homeserver in media-repo.yaml
  343. # You may have to manually specify it if using delegation or the
  344. # incoming Host doesn't match.
  345. proxy_set_header Host {{ matrix_domain }};
  346. proxy_set_header X-Real-IP $remote_addr;
  347. proxy_set_header X-Forwarded-For $remote_addr;
  348. }
  349. # Redirect other endpoints registered by the media-repo to its container
  350. # /_matrix/client/r0/admin/purge_media_cache
  351. # /_matrix/client/r0/admin/quarantine_media/{roomId:[^/]+}
  352. location ~ ^/_matrix/client/(r0|v1|v3|unstable)/admin/(purge_media_cache|quarantine_media/.*) {
  353. {% if matrix_nginx_proxy_enabled %}
  354. {# Use the embedded DNS resolver in Docker containers to discover the service #}
  355. resolver {{ matrix_nginx_proxy_http_level_resolver }} valid=5s;
  356. set $backend "{{ matrix_nginx_proxy_proxy_media_repo_addr_with_container }}";
  357. proxy_pass http://$backend;
  358. {% else %}
  359. {# Generic configuration for use outside of our container setup #}
  360. proxy_pass http://{{ matrix_nginx_proxy_proxy_media_repo_addr_sans_container }};
  361. {% endif %}
  362. # Make sure this matches your homeserver in media-repo.yaml
  363. # You may have to manually specify it if using delegation or the
  364. # incoming Host doesn't match.
  365. proxy_set_header Host {{ matrix_domain }};
  366. proxy_set_header X-Real-IP $remote_addr;
  367. proxy_set_header X-Forwarded-For $remote_addr;
  368. }
  369. # Redirect other endpoints registered by the media-repo to its container
  370. location ^~ /_matrix/client/unstable/io.t2bot.media {
  371. {% if matrix_nginx_proxy_enabled %}
  372. {# Use the embedded DNS resolver in Docker containers to discover the service #}
  373. resolver {{ matrix_nginx_proxy_http_level_resolver }} valid=5s;
  374. set $backend "{{ matrix_nginx_proxy_proxy_media_repo_addr_with_container }}";
  375. proxy_pass http://$backend;
  376. {% else %}
  377. {# Generic configuration for use outside of our container setup #}
  378. proxy_pass http://{{ matrix_nginx_proxy_proxy_media_repo_addr_sans_container }};
  379. {% endif %}
  380. # Make sure this matches your homeserver in media-repo.yaml
  381. # You may have to manually specify it if using delegation or the
  382. # incoming Host doesn't match.
  383. proxy_set_header Host {{ matrix_domain }};
  384. proxy_set_header X-Real-IP $remote_addr;
  385. proxy_set_header X-Forwarded-For $remote_addr;
  386. }
  387. {% endif %}
  388. location / {
  389. {% if matrix_nginx_proxy_enabled %}
  390. {# Use the embedded DNS resolver in Docker containers to discover the service #}
  391. resolver {{ matrix_nginx_proxy_http_level_resolver }} valid=5s;
  392. set $backend "{{ matrix_nginx_proxy_proxy_matrix_federation_api_addr_with_container }}";
  393. proxy_pass http://$backend;
  394. {% else %}
  395. {# Generic configuration for use outside of our container setup #}
  396. proxy_pass http://{{ matrix_nginx_proxy_proxy_matrix_federation_api_addr_sans_container }};
  397. {% endif %}
  398. proxy_set_header Host $host;
  399. proxy_set_header X-Forwarded-For {{ matrix_nginx_proxy_x_forwarded_for }};
  400. proxy_set_header X-Forwarded-Proto {{ matrix_nginx_proxy_x_forwarded_proto_value }};
  401. client_body_buffer_size 25M;
  402. client_max_body_size {{ matrix_nginx_proxy_proxy_matrix_federation_api_client_max_body_size_mb }}M;
  403. proxy_max_temp_file_size 0;
  404. }
  405. }
  406. {% endif %}