Skip to content

Instantly share code, notes, and snippets.

@spro
Created Sep 9, 2013
Embed
What would you like to do?
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