# Error when assembling chunks, status code 504

**URL:** <https://help.nextcloud.com/t/error-when-assembling-chunks-status-code-504/56751>\
**Category:** ℹ️ Support\
**Created:** [July 16, 2019, 2:18pm UTC](https://help.nextcloud.com/t/error-when-assembling-chunks-status-code-504/56751 "2019-07-16T14:18:46Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![Qtax](https://help.nextcloud.com/user_avatar/help.nextcloud.com/qtax/32/27294_2.png) [@Qtax](https://help.nextcloud.com/u/Qtax)\
**Post date:** [July 21, 2020, 9:46pm UTC](https://help.nextcloud.com/t/error-when-assembling-chunks-status-code-504/56751/11 "2020-07-21T21:46:02Z")

</div>

> [@t-info](#):
>
> where do I raise the timeout on nginx?

For my nginx setup it was enough to set the timeout to 10 min (600 seconds).

### **PHP FPM config**

Add this line:

```auto
request_terminate_timeout = 600

```

Location of the config on my system: `/usr/local/etc/php-fpm.d/nextcloud.conf`

### **nginx config**

Around/below the line `fastcgi_pass php-handler;` add this line:

```auto
fastcgi_read_timeout 600;

```

Location of my nginx conf: `/usr/local/etc/nginx/conf.d/nextcloud.conf`

* * *

I’m curious to figure out why this is taking so long tho, so made a thread about it:

> [@504 Gateway timeout for large file uploads](https://help.nextcloud.com/t/504-gateway-timeout-for-large-file-uploads/87839):
>
> I’m getting the not so uncommon error when uploading large files trough the web interface: Error when assembling chunks, status code 504 I’m a developer and would like to figure out what is actually going on here. What is Nextcloud actually doing in step 4 below? How common is this for large file uploads? Does this happen to everyone that have \<= 1min timeouts and doing big enough file uploads? The course of events No other load is on the server at the time. Uploading a 5GB file through …

---

_[View the full topic](https://help.nextcloud.com/t/error-when-assembling-chunks-status-code-504/56751)._
