diff --git a/roles/immich/templates/nginx-vhost.conf.j2 b/roles/immich/templates/nginx-vhost.conf.j2 index 4aeb559..09c2287 100644 --- a/roles/immich/templates/nginx-vhost.conf.j2 +++ b/roles/immich/templates/nginx-vhost.conf.j2 @@ -20,6 +20,7 @@ server { server { listen 443 ssl; listen [::]:443 ssl; + http2 on; server_name {{ immich_nginx_hostname }}; # Let's Encrypt certificates (managed by Certbot) @@ -40,6 +41,12 @@ server { client_max_body_size 50000M; + # Timeouts for slow mobile uploads (client <-> nginx leg) + client_body_timeout 600s; + client_header_timeout 600s; + send_timeout 600s; + keepalive_timeout 600s; + location / { proxy_pass http://127.0.0.1:{{ immich_port }}; proxy_set_header Host $http_host; @@ -52,7 +59,12 @@ server { proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; - # Timeouts for large file uploads + # Stream uploads directly to backend instead of buffering full body on disk + proxy_request_buffering off; + proxy_buffering off; + + # Timeouts for large file uploads (nginx <-> immich leg) + proxy_connect_timeout 600s; proxy_read_timeout 600s; proxy_send_timeout 600s; }