brew install openssl jansson libjwt
wget https://nginx.org/download/nginx-1.18.0.tar.gz
tar -zxvf nginx-1.18.0.tar.gz
git clone https://github.com/TeslaGov/ngx-http-auth-jwt-module
cd nginx-1.18.0/
brew link openssl # if running on Darwin, check for LDFLAGS and CPPFLAGS
./configure --add-module=../ngx-http-auth-jwt-module \
--with-http_ssl_module \
--with-http_v2_module \
--with-ld-opt="-L/usr/local/opt/openssl/lib" \
--with-cc-opt="-I/usr/local/opt/openssl/include"
make
Use jwks-to-pem.sh to extrat x509 public key.
I am getting below error in ubuntu after ./configure running "make".
Can you please suggest any solution.
My actual plan is to validate JWT token before serving static content.
modules -I src/http/v2
-o objs/addon/src/ngx_http_auth_jwt_module.o
../ngx-http-auth-jwt-module/src/ngx_http_auth_jwt_module.c
../ngx-http-auth-jwt-module/src/ngx_http_auth_jwt_module.c: In function ‘loadAuthKey’:
../ngx-http-auth-jwt-module/src/ngx_http_auth_jwt_module.c:445:2: error: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Werror=unused-result]
445 | fread(conf->_auth_jwt_keyfile.data, 1, keySize, keyFile);