Public | Automated Build

Last pushed: 22 days ago
Short Description
Option to add json formatting to access logs
Full Description

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;
    }
}
Docker Pull Command
Owner
ricc
Source Repository

Comments (1)
budiman
2 months ago

Nice your Artikel bro.<a href="http://wingsqqpromo.blogspot.com/">Domino QQ</a>