Created
August 12, 2013 07:20
-
-
Save aterreno/6208791 to your computer and use it in GitHub Desktop.
Let's say that for some reason you want to execute an OS command via HTTP.. This nginx config does it by using LUA. http://openresty.org/ kicks ass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
worker_processes 1; | |
user root; | |
error_log logs/error.log; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
server { | |
listen 8080; | |
location / { | |
set $exec "/opt/local/bin/pkgin update; /opt/local/bin/pkgin -y install electrostatic_"; | |
set $version $arg_version; | |
content_by_lua "os.execute(ngx.var.exec .. ngx.var.version)"; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment