I keep getting 502 errors on the site at random times, and then a "no live connections" error in the nginx site-error logs.
It was working fine previously with the old servers so I don't think its an issue with nginx configuration. I understand that this is a health check error but it coincides with the 502 errors which indicate a timeout issue. I haven't changed the nginx configuration and I haven't changed anything on php too I have kept it the same as before.
The errors still come through in the nginx logs. I have also tried setting the
max_fails=3
This has masked the issue and stopped the site from going down for couple seconds but it hasn't sorted out the actual error.
The error has an issue when listening to the proxy address and port 80. It is weird because I only get some 502 errors and they are at random times. Any help would be appreciated.
upstream configuration.
upstream (backend) {
least_conn;
server server_ip max_fails=3;
server server_ip max_fails=3;
server server_ip max_fails=3;
server server_ip max_fails=3;
load balancer nginx config:
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_pass backend;
proxy_redirect off;
# Handle Web Socket Connections
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
The error:
[error] 749104#749104: *1957306 no live upstreams while connecting to upstream, client IP , server: site, request: "REQUEST URL HTTP/1.1", upstream: "http//backend address/url ", host: "site"
I have also checked the php-fpm sock setting and they are correct with what was suggested.