Am following below blog (https://developers.redhat.com/blog/2018/10/08/configuring-nginx-keycloak-oauth-oidc/) to setup an NGINX lua oidc. Below is my installation and setup, am unable to run below commands
Install all the Lua modules using luarocks:
# luarocks install lua-cjson
# luarocks install lua-resty-openidc
Results:
[root@samplesys nginx-lua]# yum install luarocks
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirror.netdepot.com
* epel: mirror.lax.genesisadaptive.com
* extras: mirror.netdepot.com
* updates: mirror.netdepot.com
Package luarocks-2.3.0-1.el7.x86_64 already installed and latest version
Nothing to do
[root@sample nginx-lua]# luarocks install lua-cjson
Warning: falling back to curl - install luasec to get native HTTPS support
Warning: Failed searching manifest: Failed fetching manifest for https://luarocks.org - Failed downloading https://luarocks.org/manifest-5.1 - /var/cache/luarocks/https___luarocks.org/manifest-5.1
Warning: Failed searching manifest: Failed fetching manifest for https://raw.githubusercontent.com/rocks-moonscript-org/moonrocks-mirror/master/ - Failed downloading https://raw.githubusercontent.com/rocks-moonscript-org/moonrocks-mirror/master/manifest-5.1 - /var/cache/luarocks/https___raw.githubusercontent.com_rocks-moonscript-org_moonrocks-mirror_master_/manifest-5.1
Warning: Failed searching manifest: Failed extracting manifest file: failed extracting /var/cache/luarocks/http___luafr.org_moonrocks_/manifest-5.1.zip
Warning: Failed searching manifest: Failed extracting manifest file: failed extracting /var/cache/luarocks/http___luarocks.logiceditor.com_rocks/manifest-5.1.zip
lua-cjson not found for Lua 5.1.
Checking if available for other Lua versions...
Checking for Lua 5.2...
Checking for Lua 5.3...
Checking for Lua 5.4...
Error: No results matching query were found for Lua 5.1.
[root@sample nginx-lua]# luarocks install lua-resty-openidc
Warning: falling back to curl - install luasec to get native HTTPS support
Warning: Failed searching manifest: Failed fetching manifest for https://luarocks.org - Failed downloading https://luarocks.org/manifest-5.1 - /var/cache/luarocks/https___luarocks.org/manifest-5.1
Warning: Failed searching manifest: Failed fetching manifest for https://raw.githubusercontent.com/rocks-moonscript-org/moonrocks-mirror/master/ - Failed downloading https://raw.githubusercontent.com/rocks-moonscript-org/moonrocks-mirror/master/manifest-5.1 - /var/cache/luarocks/https___raw.githubusercontent.com_rocks-moonscript-org_moonrocks-mirror_master_/manifest-5.1
Warning: Failed searching manifest: Failed extracting manifest file: failed extracting /var/cache/luarocks/http___luafr.org_moonrocks_/manifest-5.1.zip
Warning: Failed searching manifest: Failed extracting manifest file: failed extracting /var/cache/luarocks/http___luarocks.logiceditor.com_rocks/manifest-5.1.zip
lua-resty-openidc not found for Lua 5.1.
Checking if available for other Lua versions...
Checking for Lua 5.2...
Checking for Lua 5.3...
Checking for Lua 5.4...
Error: No results matching query were found for Lua 5.1.
There's a few things that are wrong here:
The Lua version used in the tutorial seems to be PUC Lua 5.1, which really doesn't have anything going for it anymore; the reason people use 5.1 is that LuaJIT implements that version. I don't remember to which extent openresty even still supports that version, but later versions of it are certainly built mainly to work with LuaJIT.
You don't need to install
lua-cjson
if you're using an openresty release, as it already comes bundled (see readme)Looking at the error you're getting
Failed fetching manifest for https://luarocks.org - Failed downloading https://luarocks.org/manifest-5.1
it seems that luarocks can't download the manifest file, which is either a temporary problem with luarocks.org (It works for me as I am writing this answer), or a problem with your network. Try downloading the URL from the error message using a tool likewget
orcurl
and see if that works (iscurl
even installed?)