欢迎光临
我们一直在努力

openresty lua module找不到

最后在openresty的lua_package_path配置里,加上双分号解决该问题

https://blog.csdn.net/li396864285/article/details/78493710

http://www.thijsschreijer.nl/blog/?p=1025

A more conservative way of installing your plugin’s sources is
to avoid “polluting” the LuaRocks tree, and instead, point Kong
to the directory containing them.

This is done by tweaking the lua_package_path property of your Kong
configuration. Under the hood, this property is an alias to the LUA_PATH
variable of the Lua VM, if you are familiar with it.

Those properties contain a semicolon-separated list of directories in
which to search for Lua sources. It should be set like so in your Kong
configuration file:

  • 1
  • 2

Where:

  • /<path-to-plugin-location> is the path to the directory containing the
    extracted archive. It should be the location of the kong directory
    from the archive.
  • ? is a placeholder that will be replaced by
    kong.plugins.<plugin-name> when Kong will try to load your plugin. Do
    not change it.
  • ;; a placeholder for the “the default Lua path”. Do not change it.

Example:

The plugin something being located on the file system such that the
handler file is:

  • 1
  • 2

The location of the kong directory is: /usr/local/custom, hence the
proper path setup would be:

  • 1
  • 2

Multiple plugins:

If you wish to install two or more custom plugins this way, you can set
the variable to something like:

  • 1
  • 2
  • ; is the separator between directories.
  • ;; still means “the default Lua path”.

Note: you can also set this property via its environment variable
equivalent: KONG_LUA_PACKAGE_PATH.

赞(1)
未经允许不得转载:小明编程 » openresty lua module找不到

评论 1