Hi,
I'm experience issues with a specific website that sometimes returns time out / upstream errors. This issue pops up every few days resulting in my entire website not loading and, after a while, returning a HTTP 504 timeout message. This stays until I restart the PHP engine (I usually change the PHP version).
I've been experiencing this issue for a while and tried many fixes but since the error only happens occassionaly it's hard to debug.
The error message from my proxy_error_log file (anonymised):
/etc/nginx/nginx.conf
I'm experience issues with a specific website that sometimes returns time out / upstream errors. This issue pops up every few days resulting in my entire website not loading and, after a while, returning a HTTP 504 timeout message. This stays until I restart the PHP engine (I usually change the PHP version).
I've been experiencing this issue for a while and tried many fixes but since the error only happens occassionaly it's hard to debug.
The error message from my proxy_error_log file (anonymised):
Code:
2019/12/12 10:16:19 [error] 30624#0: *81917 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 0.0.0.0, server: example.com, request: "GET / HTTP/2.0", upstream: "fastcgi://unix:///var/www/vhosts/system/example.com/php-fpm.sock", host: "example.com"
/etc/nginx/nginx.conf
Code:
#user nginx;
worker_processes 1;
#error_log /var/log/nginx/error.log;
#error_log /var/log/nginx/error.log notice;
#error_log /var/log/nginx/error.log info;
#pid /var/run/nginx.pid;
include /etc/nginx/modules.conf.d/*.conf;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#tcp_nodelay on;
#gzip on;
#gzip_disable "MSIE [1-6]\.(?!.*SV1)";
server_tokens off;
include /etc/nginx/conf.d/*.conf;
}
# override global parameters e.g. worker_rlimit_nofile
include /etc/nginx/*global_params;
- This website is the only one experiencing this issue. Other sites on the same server are still online & loading while this happens.
- Site runs on Nginx without apache (proxy mode = off)
- PHP 7.3.13, FPM application served by nginx
- Many online solutions recommend increasing the timeout values (proxy_connect_timeout). I've tried this but just resulted in it taking longer before the HTTP 504 error shows and doesn't solve the actual issue.
- CentOS Linux 7.7.1908 (Core), Plesk Obsidian Version 18.0.21 Update #5