Skip to content

Instantly share code, notes, and snippets.

@spro
Created September 9, 2013 21:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spro/6502053 to your computer and use it in GitHub Desktop.
Save spro/6502053 to your computer and use it in GitHub Desktop.
Example nginx configuration with a simple Lua script acting at /hello
events {
worker_connections 1024;
}
http {
include mime.types;
server {
listen 8080;
server_name localhost;
location / {
root /usr/local/var/www;
index index.html;
}
location /hello {
default_type text/plain;
content_by_lua '
local name = ngx.var.arg_name or "Sir"
ngx.say("Hello, " .. name .. "...")
';
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment