Skip to content

Latest commit

 

History

History
113 lines (76 loc) · 2.12 KB

File metadata and controls

113 lines (76 loc) · 2.12 KB

Installation Guide

Prerequisites

Required Libraries

Package Installation Examples

Debian/Ubuntu

apt-get install -y libjansson-dev libssl-dev

RHEL/CentOS/Fedora

dnf install -y jansson-devel openssl-devel

Alpine Linux

apk add --no-cache jansson-dev openssl-dev

Building from Source

Step 1: Clone the repository

Clone with submodules so the nxe-json dependency is fetched alongside the module:

git clone --recursive https://github.com/kjdev/nginx-auth-jwt
cd nginx-auth-jwt

If you already cloned without --recursive, initialize the submodules explicitly:

git submodule update --init --recursive

Step 2: Download nginx source

NGINX_VERSION=1.x.x
wget https://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz
tar -zxf nginx-${NGINX_VERSION}.tar.gz

Step 3: Enter the nginx source directory

cd nginx-${NGINX_VERSION}

Step 4: Configure with the dynamic module

./configure --add-dynamic-module=../

Step 5: Build

make

Step 6: Install

make install

After installation, load the module in nginx.conf:

load_module modules/ngx_http_auth_jwt_module.so;

Docker

Build the image:

docker build -t nginx-auth-jwt .

Run with a custom configuration:

docker run -p 80:80 -v $PWD/app.conf:/etc/nginx/http.d/default.conf nginx-auth-jwt

A pre-built image is available from GitHub Packages:

docker pull ghcr.io/kjdev/nginx-auth-jwt/nginx

Related Documentation