feat: harden attachment storage for level 4

This commit is contained in:
EgorAnti
2026-11-11 21:20:45 +03:00
parent e06678b6a9
commit 90a689661b
27 changed files with 650 additions and 14 deletions
+17
View File
@@ -8,6 +8,7 @@ events {
http {
# Let the application enforce the exact 10 MiB contract and return JSON.
client_max_body_size 11m;
client_body_timeout 10s;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log warn;
@@ -66,6 +67,22 @@ http {
proxy_next_upstream_tries 2;
}
location ~ ^/api/v1/chats/[0-9a-fA-F-]+/attachments$ {
proxy_pass http://api_backend;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_request_buffering on;
proxy_connect_timeout 500ms;
proxy_send_timeout 20s;
proxy_read_timeout 20s;
# Upload is not replayed: it has no idempotency key. The client may retry explicitly.
proxy_next_upstream off;
}
location / {
proxy_pass http://api_backend;
proxy_http_version 1.1;