在启动nginx时出现未知的指令"lua_package_path"

在尝试启动我的nginx服务时,我遇到了这个问题:

未知的指令"lua_package_path"

请问有人可以帮我理解它正在寻找什么吗?我已经安装了lua-resty-openidc和lua-resty-hmac,但我不知道该指令应指向哪里。

点赞
用户5923051
用户5923051

我的错..我没有意识到当你安装OpenResty后,你需要使用service openresty start来启动Openresty。

我正在使用service nginx start

2018-03-02 11:48:41
用户436794
用户436794

现在,有一些供Nginx使用的模块可以启用Lua/Openresty功能,因此您可以在基于Debian(例如Ubuntu)的系统上安装它:

sudo apt install libnginx-mod-http-lua

这样就应该提供Lua/Openresty功能-只要您的系统在nginx.conf文件中包含正确的模块-就像在Ubuntu上一样-即它包含像这样的一行include /etc/nginx/modules-enabled/*.conf;,这应该包括一个包含mod-http-lua.conf文件的文件:

load_module modules/ngx_http_lua_module.so;
2021-10-11 13:16:01