From 392635af86cbf236026272ec078842e19c27f703 Mon Sep 17 00:00:00 2001 From: hladu357 Date: Mon, 3 Jun 2024 18:47:10 +0200 Subject: [PATCH] plain module --- conf/nginx.conf | 24 ++++++++++++++++++++++++ lua/key_header.lua | 5 +++++ 2 files changed, 29 insertions(+) create mode 100644 conf/nginx.conf create mode 100644 lua/key_header.lua diff --git a/conf/nginx.conf b/conf/nginx.conf new file mode 100644 index 0000000..760f83b --- /dev/null +++ b/conf/nginx.conf @@ -0,0 +1,24 @@ +daemon off; +master_process off; + +error_log /dev/stdout info; + +events { + worker_connections 1024; +} + +http { + access_log /dev/stdout; + + lua_package_path "$prefix/lua/?.lua;;"; + server { + listen 80; + location / { + default_type text/plain; + content_by_lua_block { + local key_header = require "key_header" + key_header.greet("a Lua module") + } + } + } +} diff --git a/lua/key_header.lua b/lua/key_header.lua new file mode 100644 index 0000000..786c6b9 --- /dev/null +++ b/lua/key_header.lua @@ -0,0 +1,5 @@ +local _M = {} +function _M.greet(name) + ngx.say("Greetings from ", name) +end +return _M