LUA require search path specification method
If it is a *.LUA file, it uses a library written by itself or a library written by a third party, but you don't want to Put it in the lua installation directory, and you can specify the path of the require search in the code
package.path = '/usr/local/share/lua/5.1/?.lua;/home/resty/?.lua;' -- search for lua modules package.cpath = '/usr/local/lib/lua/5.1/?.so;' -- search for the so module
If you want to reference third-party libraries in the nginx.conf file, you need to add the following code to the http section
lua_package_path '/usr/local/share/lua/5.1/?.lua;/home/resty/?.lua;'; lua_package_cpath '/usr/local/lib/lua/5.1/?.so;';