Hi Tom, hope you're doing well.
On Sat, Mar 26, 2022 at 09:55:48PM +0100, Tom Hall wrote: > > I am looking to replace some lua scripting we have to do an allowlist, > I found > https://medium.com/geekculture/building-a-simple-bot-protection-with-nginx-javascript-module-njs-and-typescript-386b2207ba90 > and it seems to give me a good idea how to port my lua > > const fs = require('fs'); > const badReputationIPs = loadFile('/var/lib/njs/ips.txt'); > > Is there an equivalent in njs? It seems not if you are starting a new > lightweight VM for every request. > Is the answer to do a subrequest and cache it or something? I'd recommend to tweak the architecutre a bit and use a key-value store instead of an access to a file. -- Sergey A. Osokin _______________________________________________ nginx-devel mailing list -- nginx-devel@nginx.org To unsubscribe send an email to nginx-devel-le...@nginx.org