502 Bad Gateway nginx

Table of Content

Дана помилка виникає коли не вистачає часу для виконання запиту. Наприклад виконується експорт продуктів.
Є декілька способів вирішення проблеми:
1. Редагуємо php-fpm конфіг
# vi /etc/php-fpm.d/md-fashion.conf
# збільшуємо даний параметр до відносно великої цифри
request_terminate_timeout = 18000s

2. Наступний спосіб в редагуванні відредагувати час в nginx
# server will close connection after this time
keepalive_timeout 150000; #15

# number of requests client can make over keep-alive
keepalive_requests 100000;

# allow the server to close connection on non responding client, this will free up memory
reset_timedout_connection on;

# request timed out
client_body_timeout 120000; #12
client_header_timeout 120000; #12

# if client stop responding, free up memory
send_timeout 100000; #10

3.Try raising max_execution_time setting in php.ini file (CentOS path is /etc/php.ini):
max_execution_time = 300

Leave a Reply

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