0

We are using nginx as a reverse proxy in our cloud infrastructure, and it's pretty handy. I'd like to use it for something else though. On some of our VMs, there is a process that I need to be able to confirm is running. Ideally, I'd like to have nginx running, serving out a single location. When visiting that location, nginx should check to see if the process is running (by greping the output from ps or something), and return 200 if it is and something else if it isn't. Unfortunately I find nginx's documentation unusually difficult to read, so I haven't been able to figure out how to do that (or something like it).

Note that these VMs have no other webserver processes running, and aren't open to external networks, so I'm not concerned if it's a bit flaky

SamBarham
  • 143
  • 1
  • 1
  • 4
  • 2
    Can you elaborate more, are your trying to monitor an application using nginx ? If that is what you are looking to do with nginx then you need to write some code and access that code/page using browser which you can do else there is no way nginx can do a monitoring for you. – Pratap Sep 12 '14 at 06:05
  • 1
    Make a new location in nginx /check and proxypass to an sh script, that script will return your status. This is the most eficient, nginx cant execute system comamands. – Alin Andrei Sep 12 '14 at 13:50
  • To elaborate more : I have a VM that needs to have a particular process running on it. I want a way to detect that that process is running from my deployment systems. On other VMs that have (for example) tomcat or nginx running already, I have them set up to return a 200 response on a specific uri if all is well. But this particular VM doesn't have any webserver type processes running for me to query, so I'm trying to work out how to do so easily. Nginx seemed like a possibility, but no worries if it's too 'square peg in round hole' – SamBarham Sep 14 '14 at 22:22

0 Answers0