nowfound

Dev tools · December 30, 2025

AD

A dynamic key-value IP allowlist for Nginx

I am currently working on a larger project that needs a short-lived HTTP "auth" based on a separate, out-of-band authentication process. Since every allowed IP only needs to be allowed for a few minutes at a time on specific server names, I created this project to solve that. It should work with any Redis-compatible database. For the docker-compose example, I used valkey. This is mostly useful if you have multiple domains that you want to control access to. If you want to allow 1.1.1.1 to mywebsite.com and securesite.com, and 2.2.2.2 to securesite.com and anothersite.org for certain TTLs,…

What it does

In the maker’s words, at launch

I am currently working on a larger project that needs a short-lived HTTP "auth" based on a separate, out-of-band authentication process. Since every allowed IP only needs to be allowed for a few minutes at a time on specific server names, I created this project to solve that. It should work with any Redis-compatible database. For the docker-compose example, I used valkey. This is mostly useful if you have multiple domains that you want to control access to. If you want to allow 1.1.1.1 to mywebsite.com and securesite.com, and 2.2.2.2 to securesite.com and anothersite.org for certain TTLs, you just need to set hash keys in your Redis-compatible database of choice like: 1.1.1.1: - mywebsite.com: 1 (30 sec TTL) - securesite.com: 1 (15 sec TTL) 2.2.2.2: - securesite.com: 1 (3600 sec TTL) - anothersite.org: 1 (never expires) Since you can use any Redis-compatible database as the backend, per-entry TTLs are encouraged. An in-process cache can also be used, but is not enabled unless you pass --enable-l1-cache to kvauth. That makes successful auth_requests a lot faster since the program is not reaching out to the key/value database on every request. I didn't do any hardcore profiling on this but did enable the chi logger middleware to see how long requests generally took: kvauth-1 | 2025/12/30 21:32:28 "GET http://127.0.0.1:8888/kvauth HTTP/1.0" from 127.0.0.1:42038 - 401 0B in 300.462µs # disallowed request nginx-1 | 192.168.65.1 - - [30/Dec/2025:21:32:28 +0000] "GET / HTTP/1.1" 401 179 "-" "curl/8.7.1" kvauth-1 | 2025/12/30 21:32:37 "GET http://127.0.0.1:8888/kvauth HTTP/1.0" from 127.0.0.1:40160 - 401 0B in 226.189µs # disallowed request nginx-1 | 192.168.65.1 - - [30/Dec/2025:21:32:37 +0000] "GET / HTTP/1.1" 401 179 "-" "curl/8.7.1" # IP added to redis allowlist kvauth-1 | 2025/12/30 21:34:02 "GET http://127.0.0.1:8888/kvauth HTTP/1.0" from 127.0.0.1:54032 - 200 0B in 290.648µs # allowed, but had to reach out to valkey kvauth-1 | 2025/12/30 21:34:02 "GET http://127.0.0.1:8888/kvauth HTTP/1.0" from 127.0.0.1:54044 - 200 0B in 4.041µs nginx-1 | 192.168.65.1 - - [30/Dec/2025:21:34:02 +0000] "GET / HTTP/1.1" 200 111 "-" "curl/8.7.1" kvauth-1 | 2025/12/30 21:34:06 "GET http://127.0.0.1:8888/kvauth HTTP/1.0" from 127.0.0.1:51494 - 200 0B in 6.617µs # allowed, used cache kvauth-1 | 2025/12/30 21:34:06 "GET http://127.0.0.1:8888/kvauth HTTP/1.0" from 127.0.0.1:51496 - 200 0B in 3.313µs nginx-1 | 192.168.65.1 - - [30/Dec/2025:21:34:06 +0000] "GET / HTTP/1.1" 200 111 "-" "curl/8.7.1 IP allowlisting isn't true authentication, and any production implementation of this project should use it as just a piece of the auth flow. This was made to solve the very specific problem of a dynamic IP allow list for NGINX.

Does the same job

all alternatives →
  • CO
    Ceryx – Open-source dynamic Nginx2015 · sourcelair.com · ▲64
  • TB
    Top, but for Nginx2020 · github.com · ▲219
  • AA
    An API to provision custom hostnames with SSL2017 · ▲90

    We launched an API for custom hostnames today. A simple HTTP post with a hostname gets a temp hostname with CNAME/a record instructions, as soon as DNS is setup we issue SSL and start accepting traffic for that hostname. It's the quickest way we know of to provision custom hostnames: https://fly.io/mix/custom-hostnames/ When we started building Fly, we figured it was too late to "make SSL easy and the customers will come". Lets Encrypt changed the world, and we knew many companies rolling their own SSL support with nginx, Traefik, etc, etc. It seemed like a…

  • WI
    We (IPinfo) built a free IP data API that supports unlimited requests2025 · ▲7

    I am Abdullah from IPinfo. We have finally launched our API service that supports an unlimited amount of requests to fetch IP to Country and ASN database. It is free to use. https://ipinfo.io/lite Try out this token for the next several to check out the API service: a6c2e5328296f5 https://api.ipinfo.io/lite/8.8.8.8?token=a6c2e5328296f5 https://api.ipinfo.io/lite/me?token=a6c2e5328296f5 - The API system is built using Node.js from the ground up but we are currently moving our backend to Rust. We processed over 2 trillion requests last…

  • KeyHippo [LW24]2024 · ▲141

    Add API key auth to Postgres Row Level Security (RLS) policy

  • AS
    A simple self-hosted ngrok alternative2019 · ▲34

    This is a proof of concept utility which allows you to expose local services to the internet at large: https://github.com/skx/tunneller In short it is a simple ngrok alternative, which you can self-host. Because it is a proof of concept it hasn't been tested extensively, but it seems like it will solve my immediate-needs. Of course it needs test, and structure added. But feedback can't hurt :)

More dev tools this month

the category →
  • Dograh592

    The open source VAPI alternative

    Dev tools · 25d ago · dograh.com

  • Meridian530

    Don't let your work go unnoticed. Get promoted!

    Dev tools · 20d ago · meridiona.com

  • x1516

    Lovable for iPhone apps go from idea to App Store

    Dev tools · 11d ago · x1.new

  • Open-source GTM skills for technical founders

    Dev tools · 29d ago · gtmcofounder.com

  • OpenTrailPaper is open-source bike computer firmware for the LilyGO T5S3 4.7" E-Paper PRO. It supports offline maps, GPX routes, FIT recording and Bluetooth sensors.

    Dev tools · 2d ago · opentrailpaper.com

  • Nuphos380

    The AI-Native DevOps Workspace.

    Dev tools · 24d ago · nuphos.ai

Launched alongside, December 2025

the whole month →
  • GP

    Life & fun · Dec 2025 · dosaygo-studio.github.io

  • JG

    Hi everyone! My name's Luke and I made the original Jmail here alongside Riley Walz. We had a ton of friends collaborate on building out more of the app suite last night in lieue of DOJ's "Epstein files" release. Please AMA!

    Life & fun · Dec 2025 · jmail.world

  • Design and ship studio-grade landing pages with AI

    AI · Dec 2025 · loki.build

  • AI turns your health goals into a 7-day menu & grocery list

    AI · Dec 2025 · planeatai.com

  • 2G

    Community, All the HN belong to you. This is an archive of hacker news that fits in your browser. When I made HN Made of Primes I realized I could probably do this offline sqlite/wasm thing with the whole GBs of archive. The whole dataset. So I tried it, and this is it. Have Hacker News on your device. Go to this repo (https://github.com/DOSAYGO-STUDIO/HackerBook): you can download it. Big Query -> ETL -> npx serve docs - that's it. 20 years of HN arguments and beauty, can be yours forever. So they'll never die. Ever. It's the unkillable static archive of HN and it's…

    Dev tools · Dec 2025 · hackerbook.dosaygo.com

  • AI video studio for viral social clips

    AI · Dec 2025 · cybercut.ai