In some cases, the long-running requests failed with the error message “504: Gateway Timeout” in the NGINX web server. To solve this issue, you need to increase the request timeout in NGINX web server configuration. The default, NGINX request timeout is 60 seconds. Which can be increased or decreased by updating the configuration files.
In this speedy FAQ, you will figure out how to change the request timeout in the NGINX web server.
Increase Request Timeout in NGINX
In case, you just want to increase request timeout for a specific server or subdomain, then add the directives for its server block only. Edit the specific server block configuration file and add the following settings:
After making the changes, you must restart the NGINX service to apply changes. The systems running with Systemd can use the following command.
All done that's it, With the above changes, you have successfully increased the request timeout in the NGINX web server.
Conclusion
This tutorial helps you to increase request timeout in the NGINX web server.