So my site has been running for the past month just fine then all of a sudden it stops working with an error: 502 Bad Gateway nginx/1.10.0 (Ubuntu)
The address bar shows secure, which probably means it might not be Nginx at fault. I have a Digital Ocean Ubuntu 16.04 droplet running Nginx as a load balancer, the address points to another 16.04 droplet running Apache. I did some digging around and found the following:
Nginx logs shows an error log for every request, similar to this line:
2017/05/10 16:26:07 [error] 1578#1578: *34 connect() failed (111:
Connection refused) while connecting to upstream, client: CLIENT_IP,
server: www.jected.io, request: “GET / HTTP/1.1”, upstream:
“http://PRIVATE_IP:80/”, host: “www.jected.io”, referrer:
2) In the Ubuntu instance that has WordPress, when I run the command
curl IP_ADDR:80, it stops for about half a second and does not print anything.
3) I tried adding a PHP file that echos a text and ran the command
curl IP_ADDR:80/test.php and successfully prints the text, so I guess we can rule out PHP not working.
What should be my next debugging steps? Thanks.
Read more here: WordPress site shows 502 Bad Gateway