dev.rahul
dev.rahul

Reputation: 151

Failed to load resource: the server responded with a status of 504 (Timeout while reading response from Server) Node.js,Nginx

While trying to upload large files, I am getting 504 timeout error. Using node.js/multer , cloudflare , nginx , ec2. the network is not that great and it takes time to upload the file, getting timeout after 4-7 minutes into the upload. was not spotting an exact same timeout periods, it is always random

Upvotes: 1

Views: 2748

Answers (2)

Sangeeth John
Sangeeth John

Reputation: 330

It might be due to Cloudflare free package that limits you from uploading files greater than 50mb.

Upvotes: 1

mobby
mobby

Reputation: 371

In your Nginx configurations for the server, probably you need to change the limit at

client_max_body_size 5M;

to something like 10M or whatever your max file size is

client_max_body_size 10M;

plus if using nginx proxy increase timeout limits too

proxy_connect_timeout       600;
proxy_send_timeout          600;
proxy_read_timeout          600;
send_timeout                600;

Upvotes: 0

Related Questions