Skip to content

DhananjayPurohit/ngx_l402

Repository files navigation

ngx_l402 — L402 Nginx Module

An L402 authentication module for Nginx that enables Lightning Network-based monetization for your REST APIs (HTTP/1 and HTTP/2).

Supports LND, LNC, CLN, Eclair, LNURL, NWC, and BOLT12 backends.

L402 module demo


📖 Documentation

Full documentation is available at: https://dhananjaypurohit.github.io/ngx_l402/


⚡ Quick Start

Requires NGINX 1.28.0 or later.

docker run -d \
  --name l402-nginx \
  -p 8000:8000 \
  -e LN_CLIENT_TYPE=LNURL \
  -e LNURL_ADDRESS=username@your-lnurl-server.com \
  -e ROOT_KEY=$(openssl rand -hex 32) \
  ghcr.io/dhananjaypurohit/ngx_l402:latest

Test it:

curl http://localhost:8000/           # 200 OK
curl -i http://localhost:8000/protected  # 402 Payment Required

Contributing

See CONTRIBUTING.md for guidelines.

License

MIT

About

nginx module for L402 authentication to enable Lightning Network-based API monetization

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages