Skip to content
This repository has been archived by the owner on Mar 28, 2023. It is now read-only.

trailofbits/nginx-json-kss

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

nginx-json-kss

Painless JSON logging for Nginx.

Building

nginx-json-kss is a standard Nginx module. You can build it by pointing nginx's ./configure script at it:

$ git clone https://github.com/trailofbits/nginx-json-kss
$ cd /path/to/nginx/source
$ ./configure --your-other-options --add-module=/path/to/nginx-json-kss
$ make
$ sudo ./objs/nginx

Usage

By default, the module will log to /var/log/nginx/access.jsonl, one JSON record per line. You can change this on global, per-server, or per-location basis:

http {
    json_kss /tmp/global.jsonl;

    server {
        listen 80 default_server;
        json_kss /tmp/server.jsonl;

        location /special_location {
            json_kss /tmp/location.jsonl;
        }
    }
}

More specific specifications always take precedence, meaning that a request to /special_location on port 80 will only be logged in /tmp/location.jsonl and not any higher-up logs.

Releases

No releases published

Packages

No packages published

Languages