Nginx - 504 Gateway Time-out - upstream timed out - Connection timed out

Nginx - 504 Gateway Time-out - upstream timed out - Connection timed out

Hi,

I have another problem with the Nginx webserver on the linux server. I'm getting a 504 Gateway Time-out error during a long import. I ask someone for help. Thanks

ERROR
------------------------
504 Gateway Time-out
nginx/1.18.0 (Ubuntu)


tail /var/log/nginx/error.log
------------------------

/var/run/php/php7.4-fpm.sock:", host: "192.168.17.2:8015", referrer: "http://192.168.17.2:8015/c/y"
2020/11/23 10:35:59 [error] 206255#206255: *22886 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 192.168.4.21, server: , request: "GET /admin-import/bike HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.4-fpm.sock", host: "192.168.17.2:8015", referrer: "http://192.168.17.2:8015/admin"



REPLY


Hello,

modify the configuration of Nginx + PHP - it is necessary to increase the limits, try to increase max_execution_time and max_input_time in php.ini, then in the nginx virtualhost fastcgi_read_timeout as follows:

vim /etc/php/7.4/fpm/php.ini

.................
; Maximum execution time of each script, in seconds
; http://php.net/max-execution-time
; Note: This directive is hardcoded to 0 for the CLI SAPI
max_execution_time = 300

; Maximum amount of time each script may spend parsing request data. It's a good
; idea to limit this time on productions servers in order to eliminate unexpectedly
; long running scripts.
; Note: This directive is hardcoded to -1 for the CLI SAPI
; Default Value: -1 (Unlimited)
; Development Value: 60 (60 seconds)
; Production Value: 60 (60 seconds)
; http://php.net/max-input-time
max_input_time = 180
....................




vim /etc/nginx/sites-available/virtualhost.conf

server {
.................
fastcgi_buffers 16 32k;
fastcgi_buffer_size 64k;
fastcgi_busy_buffers_size 64k;
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
fastcgi_read_timeout 180;
....................


systemctl reload nginx;systemctl restart php7.4-fpm


Související obsah

linux

bash

terminal

webserver

nginx

error

Komentáře

Vaše reakce na Nginx - 504 Gateway Time-out - upstream timed out - Connection timed out

Reference

Podívejte se na naše reference

Prohlédnout

Aplikace

Podívejte se na naše aplikace

Prohlédnout

Co umíme?

Podívejte se co umíme

Prohlédnout

Co umíme?

Vytváříme sofistikované aplikace pro náročné

Od webových aplikací přes android až po převodové můstky či složité informační systémy.

Podívejte se k nám

Máte ještě čas? Podívejte se na další rubriky

Tento web používá soubory cookie. Dalším procházením tohoto webu vyjadřujete souhlas s jejich používáním.. Více informací zde.