Monday, 22 October 2018

NGINX randomly stops working, required manual restart

I have an issue I am not sure how to troubleshoot. My setup:

  • Amazon EC2 (t2.medium) running Ubuntu Linux 16.04 (fully up to date)
  • NGINX 1.10.3
  • 8 websites running Node JS (Express) that are bound to ports 3000-3007 through pm2, with NGINX as the reverse proxy (proxy_pass in virtual host files)
  • PHP 7.1 (to power a Wordpress site)
  • The Node sites use the Wordpress REST API (from the Wordpress site) to serve content

The Issue:

Every few days it seems like NGINX stops working. I can tell because I am unable to access the Wordpress site until I run sudo service nginx restart. It does not seem to be a PHP issue, since if I restart PHP the Wordpress site DOES NOT go back online until the NGINX restart. The server logs in /var/log/nginx don't seem to give any insight, and I am unsure how to troubleshoot the issue.

Any ideas on where to start? Any monitoring I can set up (apart form just a basic "site down") that might provide insight? Maybe there is some setting that I can toggle in NGINX that handles overuse (if that is the issue)?



from NGINX randomly stops working, required manual restart

No comments:

Post a Comment