pivoche
pivoche

Reputation: 17

LuaJIT -- "ngx" module isn't found. Should I install it?

I'm trying to create a Hello World in Lua using LuaJit for nginx. When I run a script:

luajit my_test.lua

I get this:

luajit: my_test.lua: attempt to index global 'ngx' (a nil value)

Do I have to install a library? I've already tried "luarocks install " with "ngx", "nginx", "ngx_lua" and some others -- they weren't found.

Error: No results matching query were found.

Why isn't it getting found? Should I install a module at all?

Upvotes: 1

Views: 1014

Answers (1)

DarkWiiPlayer
DarkWiiPlayer

Reputation: 7046

ngx is not a part of Lua, so it cannot be found. It also isn't possible to just install it as a library.

The only place where ngx can be used is inside openresty.

Upvotes: 2

Related Questions