504 Gateway Time-out

Evet – Ancak %100 fixleme gibi bir durum söz konusu olmayabiliyor bunun nedeni ise, kullanmış olduğunuz yazılımda ki kod hataları

İlgili hatayı giderebilmek için sunucu tarafında yapılması gereken konfigürasyon aşağıdaki gibidir.

php.ini dosyamızda bulunan max_execution_time değerini aşağıdaki gibi 300 olarak değişelim. pre> max_execution_time = 300

Nginx konfigürasyon (nginx.conf) dosyamızda ise aşağıdaki işlemleri gerçekleştirelim.

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

nginx servisini yeniden başlatalım.

service nginx reload

sed -i “s/memory_limit = .*/memory_limit = 512M/” /etc/php/7.2/fpm/php.inised -i “s/upload_max_filesize = .*/upload_max_filesize = 128M/” /etc/php/7.2/fpm/php.inised -i “s/post_max_size = .*/post_max_size = 128M/” /etc/php/7.2/fpm/php.inised -i “s/zlib.output_compression = .*/zlib.output_compression = on/” /etc/php/7.2/fpm/php.inised -i “s/max_execution_time = .*/max_execution_time = 180000/” /etc/php/7.2/fpm/php.ini
sed -i “s/memory_limit = .*/memory_limit = 512M/” /etc/php/7.2/cli/php.inised -i “s/upload_max_filesize = .*/upload_max_filesize = 128M/” /etc/php/7.2/cli/php.inised -i “s/post_max_size = .*/post_max_size = 128M/” /etc/php/7.2/cli/php.inised -i “s/zlib.output_compression = .*/zlib.output_compression = on/” /etc/php/7.2/cli/php.inised -i “s/max_execution_time = .*/max_execution_time = 180000/” /etc/php/7.2/cli/php.ini

Create a backup of the original file nginx.conf:

# cp /etc/nginx/nginx.conf /etc/nginx/nginx.conf_old

Open the file /etc/nginx/nginx.conf in any text editor and add the following directives inside the http {} section:

proxy_send_timeout 1200s;
proxy_read_timeout 1200s;
fastcgi_send_timeout 1200s;
fastcgi_read_timeout 1200s;

Restart the nginx service:

# service nginx restart