Initial use of OpenResty

http://blog.csdn.net/yoara/article/details/52484268


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;';

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326395261&siteId=291194637