FAQ. Error "502 Bad Gateway and 504 Gateway Time-out": различия между версиями

Материал из WiKi - UserSide
(Новая страница: «en | ru During the operation, you may experience errors ''''502 Bad Gateway'''' and ''''504 Gateway Time-out'''': thumb|1200px|center thumb|1000px|center These errors are HTTP status codes, one of the standard server responses to a browser request. It is common f...»)
 
(Полностью удалено содержимое страницы)
Метка: очистка
 
Строка 1: Строка 1:
[[FAQ._Error_"502_Bad_Gateway_and_504_Gateway_Time-out"|en]] | [[FAQ._Ошибки_"502_Bad_Gateway_и_504_Gateway_Time-out"|ru]]


During the operation, you may experience errors ''''502 Bad Gateway'''' and ''''504 Gateway Time-out'''':
[[Файл:502_Bad_Gateway.png|thumb|1200px|center]]
[[Файл:504_Gateway_Time-out.png|thumb|1000px|center]]
These errors are HTTP status codes, one of the standard server responses to a browser request.
It is common for these errors to occur when performing a request to retrieve the "List of connected ONUs/ONTs". The execution time depends on the number of ONUs on the OLT and can take up to 10 minutes. But it can also occur with other queries.
The main reason for the ''''502 Bad Gateway'''' and ''''504 Gateway Time-out'''' errors is insufficient time-out values.
If you get any of these errors, you should check your timeout settings. And change them to the correct values.
Here are some examples of how to change them:
'''1) php.ini и  PHP-FPM Pool'''
* The following commands modify the configuration files to increase the timeouts up to 180 seconds:
sudo sed -i "s@max_execution_time.*@max_execution_time = 180@" /etc/php/7.4/fpm/php.ini
sudo sed -i "s@max_input_time.*@max_input_time = 180@" /etc/php/7.4/fpm/php.ini
sudo sed -i 's@;request_terminate_timeout.*@request_terminate_timeout = 180@' /etc/php/7.4/fpm/pool.d/www.conf
sudo systemctl restart php7.4-fpm
After restarting the php-fpm service, check that the changes have taken effect.
This can be done on the USERSIDE page: '''Menu - Settings - Main - Various - phpinfo()'''.
[[Файл:2023-02-24_15-53.png|thumb|1200px|center]]
'''2) NGINX config'''
* In the server configuration for userside for the <code>location ~ \.php$</code> block, change the timeout value to 180 seconds and restart NGINX:
fastcgi_read_timeout = 180
sudo nginx -t && sudo nginx -s reload
''* The default path is /etc/nginx/conf.d/default.conf (if the standard installation instructions were used).  Edit the value in the required configuration file if you have more than one site on the server and have configured with this consideration.''

Текущая версия от 20:36, 16 марта 2023