NginX: Gateway Time-Out

One of the web server that run on Nginx is having 504 Gateway Time-out error. This can be fixed by increasing the send_timeout directive in nginx.conf.

Steps as below:

1. Open the nginx configuration files via your favourite text editor:

$ vi /usr/local/nginx/nginx.conf

2. Find send_timeout directive and increase the value higher. In this case, I increase the value from 3m to 10m:

send_timeout 10m;

3. Save the file and reload nginx using following command:

$ kill -HUP `ps -ef | grep nginx | grep master | awk {'print $2'}`

Notes: Some user might still get this error after applying the solution. It also depending on how your application works. Other directives that need to be consider for this error are:


3 thoughts on “NginX: Gateway Time-Out

  1. Did that (3600 was my value for up to 1 hour) but still no dice.. times out in 60 seconds. I checked all other values.. under fastcgi etc. But nothing.


    1. You might need to check another area as your application might different requirement. I have updated the post by adding Notes.


  2. The following directive can solve this problem:
    fastcgi_buffers 256k
    fastcgi_buffer_size 128K
    fastcgi_busy_buffers_size 256K
    fastcgi_temp_file_write_size 256K


Leave a Reply

Your email address will not be published. Required fields are marked *