File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
Openresty/lua-common-package Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change 20
20
└── nginx
21
21
```
22
22
+ [Lua require 相对路径 博客园详解](http://www.cnblogs.com/smallboat/p/5552407.html)
23
- + 相对路径总结
23
+ + 相对路径总结(相对于nginx安装目录)
24
24
+ **当前目录** :`/opt/openresty/nginx/conf/Lua`
25
25
+ 注意:如果在当前没有了,以下的代码运行是没有问题的
26
26
+ 就是所有的lua脚本代码全部写在Lua文件夹下面去
70
70
```
71
71
location /api {
72
72
lua_code_cache off;
73
- content_by_lua_file /opt/openresty/nginx/conf/Lua/main.lua;
73
+ content_by_lua_file /opt/openresty/nginx/conf/Lua/main.lua; # 绝对路径
74
+ #content_by_lua_file conf/Lua/main.lua; # 相对路径(相对于nginx安装目录)
74
75
}
75
76
```
76
77
+ CURL 请求结果
Original file line number Diff line number Diff line change 24
24
+ [ Openresty 学习] ( #Openresty_web_knowledge )
25
25
+ [ 安装] ( #Openresty_install_knowledge )
26
26
+ [ 默认配置信息] ( #Openresty_config_knowledge )
27
+ + [ Lua require 绝对和相对路径问题(一个文件引入另外一个文件的Function),已经解决] ( https://github.com/Tinywan/Lua-Nginx-Redis/blob/master/Openresty/lua-common-package/lua-require.md )
27
28
+ [ luajit 执行文件默认安装路径] ( #Openresty_web_knowledge )
28
29
+ [ lua-resty-redis 扩展] ( #Openresty_resty-redis )
29
30
+ [ lua-resty-websocket 扩展] ( #Openresty_resty-websocket )
362
363
The man name is Tinywan
363
364
The man name is Phalcon
364
365
```
365
- + [Lua require 绝对和相对路径问题(一个文件引入另外一个文件的Function),已经解决](https://github.com/Tinywan/Lua-Nginx-Redis/blob/master/Openresty/lua-common-package/lua-require.md)
366
366
#### <a name="Openresty_resty-redis"/> lua-resty-redis 扩展 (是openresty下操作redis的模块)
367
367
+ 代码引入:`lua_package_path "/opt/openresty/nginx/lua/lua-resty-redis/lib/?.lua;;";`
368
368
+ Lua脚本实现一个CDN的反向代理功能(智能查找CDN节点)(测试成功,可上线)
You can’t perform that action at this time.
0 commit comments