Created
September 9, 2013 21:53
-
-
Save spro/6502053 to your computer and use it in GitHub Desktop.
Example nginx configuration with a simple Lua script acting at /hello
This file contains 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
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