Use nginx to call shell script - simplest way?

Richard Kearsley Richard.Kearsley at m247.com
Wed Mar 9 22:15:30 MSK 2011


Can't get much simpler than that lua example...
Agentzh, I'm not too familiar with lua but your module helped me do something really important that I needed. Is that os.execute a lua feature or an nginx_lua feature? I'm sure there are a lot more ways it can be useful. Any plans to post up more examples that would suprise us with what's possible?


Sent from my iPhone

On 9 Mar 2011, at 18:53, John Moore <grails at jmsd.co.uk> wrote:

> On 08/03/11 12:19, agentzh wrote:
>> 
>> Using ngx_lua [1]:
>> 
>>     location /restart-java-app {
>>           content_by_lua 'os.execute("/bin/restart-my-java-app")';
>>     }
>> 
>> But it's blocking, only suitable for personal use ;)
>> 
>> 
> 
> Thanks for the suggestion. It's probably rather more than I need, though, and looks a little complex to set up. At the moment I'm leaning towards simply proxying to thttpd, which is very lightweight and can do CGI, so I can call a shell script directly.
> 
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://nginx.org/mailman/listinfo/nginx



More information about the nginx mailing list