Skip to content

rccrdpccl/nginx-jsonlog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Nginx JSON log

Nginx docker image with json log format.

Usage

Set variable $application to your application name, and create a server directive specifying "json" as access_log type, as in the below example.

default.conf example

server {

    listen  80;

    set $application 'nginx-jsonlog';

    access_log /var/log/nginx/access.log json;
    error_log  /var/log/nginx/error.log error;

    location / {
        return 200 'hello world';
        add_header Content-Type text/plain;
    }

    location /healthcheck {
        return 200 'healthy';
        add_header Content-Type text/plain;
    }
}

About

Nginx docker image with json log format

Resources

License

Stars

Watchers

Forks

Packages

No packages published