atom feed16 messages in ru.sysoev.nginxRe: Use nginx to call shell script - ...
FromSent OnAttachments
John MooreMar 8, 2011 4:07 am 
agentzhMar 8, 2011 4:19 am 
António P. P. AlmeidaMar 8, 2011 10:59 am 
John MooreMar 9, 2011 10:42 am 
Richard KearsleyMar 9, 2011 11:15 am 
John MooreMar 9, 2011 12:39 pm 
agentzhMar 9, 2011 7:38 pm 
agentzhMar 9, 2011 7:52 pm 
Elena ZwetkowMar 10, 2011 12:16 am 
agentzhMar 10, 2011 12:28 am 
Elena ZwetkowMar 10, 2011 1:01 am 
agentzhMar 10, 2011 1:33 am 
Alexander KunzMar 15, 2011 3:14 pm 
agentzhMar 15, 2011 7:28 pm 
Alexander KunzMar 16, 2011 12:22 am 
agentzhMar 16, 2011 12:36 am 
Subject:Re: Use nginx to call shell script - simplest way?
From:António P. P. Almeida (ap@perusio.net)
Date:Mar 8, 2011 10:59:42 am
List:ru.sysoev.nginx

On 8 Mar 2011 12h07 WET, gra@jmsd.co.uk wrote:

I have a Java web application which, once in a while for reasons I am trying to determine, sometimes becomes unresponsive. I want to give users a simple way of restarting it, via the web, so as I've used ngix a lot in the past, my first thoughts turned to having nginx running on another port, with a URL available which causes a shell script to be run. What would be the easiest, most lightweight, way to do this? Or is there some other way of effecting what I want which I haven't thought of yet?

Well you always have the option of using good ol' CGI. Use a small server like thttpd with nginx serving as reverse proxy for that or a FastCGI wrapper like fcgiwrap and execute the shell command in the CGI script.

Perhaps there's a smarter way, don't know how it compares to agentzh's Nginx embedded Lua module suggestion. You have to try it out.

--- appa