Answer the question
In order to leave comments, you need to log in
How to fix 502 error on centos 6.5?
Good afternoon!
When processing a large excel file, the server gives a 502 error ( I
tried to process this file locally on Windows - everything is fine)
in the nginx log this error:
upstream prematurely closed connection while reading response header from upstream
and what to edit.
Server: VPS centos 6.5 + Bitrix web environment
Answer the question
In order to leave comments, you need to log in
Something tells me that it's not nginx that breaks the connection, but upstream.
You need to increase max_execution_time in php.ini (there may be several configs - for the web and for the command line).
With a high degree of probability, what sits behind NGINX falls. So, you should first read the logs, and then either twist the execution time or the amount of memory per process.
Add to the script
set_time_limit(0);
ini_set('memory_limit', '1024M'); //зависит от того сколько в вашем распоряжении памяти
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question