Menu

nginx 1.31's json_set directive rejects a bad webhook payload about 13 times faster than forwarding it
📰

nginx 1.31's json_set directive rejects a bad webhook payload about 13 times faster than forwarding it

DEV Community: webdev·Alex Georgiev·2 days ago
#saHvk72J
#devtowebdev#devto#dev#backend#nginx
Reading 0:00
15s threshold

A webhook receiver I built a few years ago always worked the same way: nginx took the connection, nginx forwarded the body, and the application decided whether the payload was junk. nginx 1.31.5 adds a module that lets nginx make that decision itself, by reading fields out of the JSON body before the request ever reaches a location block. I wanted to know what that was actually worth, not just what the changelog implied.

The module is ngx_http_json_module , built with --with-http_json_module (it's compiled into the official Docker image, but not into Ubuntu's 24.04 nginx apt package, which still ships 1.24.0). It adds one directive that matters, json_set , plus a depth limit.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.