How to fix error: 504 Gateway Time-out on Nginx

Sometimes, you get the error: 504 Gateway Time-out on Nginx like this figure, how to fix it. This is simple. You follow 2 below steps: Step 1: Add this line to your PHP file set_time_limit(0); or set_time_limit(120); You can change 120 to the seconds you want. Step 2: You edit the file .conf like /etc/nginx/conf.d/default.conf, you will see the content like: server { listen ...