All good day! I struggle for several days to solve the problem of 502 bad gateway nginx when I upload heavy files (10 MB). Files up to 5 MB are loaded without errors. I tried to change the settings of PHP and Nginx, but did not help. System configuration: Ubuntu 16.04, Nginx, PHP. The following error information is given in Nginx logs:
*17 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 109.252.90.170, server: ΠΌΠΎΠΉ_ΡΠ°ΠΉΡ.ru, request$ equest: "POST /sources/preview HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.2-fpm.sock:", host: "ΠΌΠΎΠΉ_ΡΠ°ΠΉΡ.ru", referrer: "https://ΠΌΠΎΠΉ_ΡΠ°ΠΉΡ.ru/" PHP settings:
max_input_time = 600; max_execution_time = 600; pload_max_filesize = 100M; post_max_size = 100M; memory_limit = 256M; Nginx settings:
fastcgi_buffers 8 128k; fastcgi_buffer_size 256k; client_max_body_size 100M; client_body_buffer_size 128k; client_header_buffer_size 2k; fastcgi_connect_timeout 6m; fastcgi_send_timeout 6m; fastcgi_read_timeout 6m; proxy_connect_timeout 6m; proxy_send_timeout 6m; proxy_read_timeout 6m; send_timeout 6m; client_header_timeout 6m; client_body_timeout 6m; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; I tried to create the file /etc/php/7.2/fpm/conf.d/30-user.ini, where I specified the settings:
max_input_time = 600; max_execution_time = 600; pload_max_filesize = 100M; post_max_size = 100M; memory_limit = 256M; Through phpinfo () checked that all settings are used
What did I miss?
var_dump(ini_get('max_execution_time')); die;var_dump(ini_get('max_execution_time')); die;in the script that loads the files. - Total Pusherstring(3) "600"- Andrey Pisarev