dum3ng / study-issues

0 stars 0 forks source link

504 gateway timeout when use proxy in nginx #5

Closed dum3ng closed 5 years ago

dum3ng commented 5 years ago

When we proxy a request to another service in nginx, and the request takes a long time to response, nginx will return a 504 gateway timeout response. The default timeout in nginx config is 60s. To prevent the 504 error, add these configs in nginx conf file:

    proxy_send_timeout          600;
    proxy_read_timeout          600;
    send_timeout                600;