Skip to content

Commit b04097e

Browse files
committed
nginx: reduce client_body_buffer_size for non-media APIs
This is set to match the limit enforced by synapse itself.
1 parent be991f5 commit b04097e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

nginx/nginx.conf

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,9 @@ http {
191191
proxy_send_timeout 15s;
192192
proxy_read_timeout 600s;
193193

194-
client_max_body_size 100m;
194+
# MAX_PDU_SIZE = 65536
195+
# MAX_REQUEST_SIZE = 200 * MAX_PDU_SIZE
196+
client_max_body_size 13107200;
195197
client_body_buffer_size 16k;
196198

197199
proxy_pass http://synapse-main;
@@ -209,6 +211,7 @@ http {
209211
}
210212

211213
location ~ ^/_matrix/media/|^/_matrix/client/v1/media/|^/_matrix/federation/v1/media/ {
214+
client_max_body_size 100m;
212215
proxy_pass http://synapse-media_repository;
213216
}
214217

@@ -242,7 +245,9 @@ http {
242245
proxy_send_timeout 15s;
243246
proxy_read_timeout 600s;
244247

245-
client_max_body_size 100m;
248+
# MAX_PDU_SIZE = 65536
249+
# MAX_REQUEST_SIZE = 200 * MAX_PDU_SIZE
250+
client_max_body_size 13107200;
246251
client_body_buffer_size 16k;
247252

248253
proxy_pass http://synapse-main;

0 commit comments

Comments
 (0)