Nginx

From WikiWiki
Jump to navigation Jump to search

Some nginx notes


Execute Lua

local folder = ngx.var.arg_folder or "/tmp"

local command = "ls ".. folder
local handle = io.popen(command)
local result = handle:read("*a")
handle:close()
ngx.say(result )

Client AuthN

ssl_client_certificate cabundle.txt;
ssl_verify_client on;
if ($ssl_client_s_dn != "CN=VARIABLE") {
  return 403;
}

http://nginx.org/en/docs/http/ngx_http_ssl_module.html