Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how get $prefix variable in lua script #227

Closed
suifengpiao14 opened this issue Feb 27, 2018 · 2 comments
Closed

how get $prefix variable in lua script #227

suifengpiao14 opened this issue Feb 27, 2018 · 2 comments

Comments

@suifengpiao14
Copy link

how can i get the $prefix (lua_package_path ";;$prefix/?.lua;";) variable in lua file

@spacewander
Copy link
Collaborator

$prefix 这个其实不是 Nginx 变量,ngx_lua 在处理 lua_package_path 会把它展开成实际的前缀。
在 Lua 代码里可以用 ngx.config.prefix() 这个函数获取到同样的值。

@suifengpiao14
Copy link
Author

谢谢你,解决了我的问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants