-
Notifications
You must be signed in to change notification settings - Fork 47
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
unable to found cjson & resty.jwt #42
Comments
i have the same issue
2021/08/13 13:19:30 [error] 11819#11819: *89 lua entry thread aborted: runtime error: /usr/local/openresty/nginx/base-validation.lua:2: module 'resty.jwt' not found: |
did you fixed? |
I don't believe I was able to recreate when this was originally posted. Let me test this weekend and will respond with my findings. |
Working with nginx r21.
I need to decode jwt token and extract the value of a key out of it. I have downloaded the following libs
All above mentioned libs are present in /etc/nginx/saurabh/
Nginx.conf
load_module /etc/nginx/ndk_http_module.so;
load_module /etc/nginx/ngx_http_lua_module.so;
....
http {
lua_package_path "/etc/nginx/saurabh/*/lib/?.lua;;";
....
server{
....
rewrite_by_lua_file test.lua;
....
}
}
test.lua
function validate()
print("<-----Starting validate Client IP----->");
print("<-----r.uri-------------------------->", ngx.var.uri);
end
validate()
Error Message
2020/10/31 17:31:28 [error] 12#12: *17 lua entry thread aborted: runtime error: /etc/nginx/test.lua:21: module 'cjson' not found:
no field package.preload['cjson']
no file '/etc/nginx/saurabh/lua-resty-jwt/lib/cjson.lua'
no file './cjson.lua'
no file '/usr/share/nginx-luajit-2.1/cjson.lua'
no file '/usr/local/share/lua/5.1/cjson.lua'
no file '/usr/local/share/lua/5.1/cjson/init.lua'
no file '/usr/share/lua/5.1/cjson.lua'
no file '/usr/share/lua/5.1/cjson/init.lua'
no file './cjson.so'
no file '/usr/local/lib/lua/5.1/cjson.so'
no file '/usr/lib/lua/5.1/cjson.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
coroutine 0:
[C]: in function 'require'
/etc/nginx/test.lua:21: in function 'validate'
/etc/nginx/test.lua:29: in main chunk,
The text was updated successfully, but these errors were encountered: