Merge 8c51537468
into 816b7f511d
This commit is contained in:
commit
41c0c80e70
2 changed files with 6 additions and 1 deletions
|
@ -175,6 +175,10 @@ type Configuration struct {
|
||||||
// Default: 4 8k
|
// Default: 4 8k
|
||||||
LargeClientHeaderBuffers string `json:"large-client-header-buffers"`
|
LargeClientHeaderBuffers string `json:"large-client-header-buffers"`
|
||||||
|
|
||||||
|
// Enable json escaping
|
||||||
|
// http://nginx.org/en/docs/http/ngx_http_log_module.html#log_format
|
||||||
|
LogFormatEscapeJson bool `json:"log-format-escape-json,omitempty"`
|
||||||
|
|
||||||
// Customize upstream log_format
|
// Customize upstream log_format
|
||||||
// http://nginx.org/en/docs/http/ngx_http_log_module.html#log_format
|
// http://nginx.org/en/docs/http/ngx_http_log_module.html#log_format
|
||||||
LogFormatUpstream string `json:"log-format-upstream,omitempty"`
|
LogFormatUpstream string `json:"log-format-upstream,omitempty"`
|
||||||
|
@ -311,6 +315,7 @@ func NewDefault() Configuration {
|
||||||
KeepAlive: 75,
|
KeepAlive: 75,
|
||||||
KeepAliveRequests: 100,
|
KeepAliveRequests: 100,
|
||||||
LargeClientHeaderBuffers: "4 8k",
|
LargeClientHeaderBuffers: "4 8k",
|
||||||
|
LogFormatEscapeJson: false,
|
||||||
LogFormatStream: logFormatStream,
|
LogFormatStream: logFormatStream,
|
||||||
LogFormatUpstream: logFormatUpstream,
|
LogFormatUpstream: logFormatUpstream,
|
||||||
MaxWorkerConnections: 16384,
|
MaxWorkerConnections: 16384,
|
||||||
|
|
|
@ -93,7 +93,7 @@ http {
|
||||||
# disable warnings
|
# disable warnings
|
||||||
uninitialized_variable_warn off;
|
uninitialized_variable_warn off;
|
||||||
|
|
||||||
log_format upstreaminfo '{{ buildLogFormatUpstream $cfg }}';
|
log_format upstreaminfo {{ if $cfg.LogFormatEscapeJson }}escape=json {{ end }}'{{ buildLogFormatUpstream $cfg }}';
|
||||||
|
|
||||||
{{/* map urls that should not appear in access.log */}}
|
{{/* map urls that should not appear in access.log */}}
|
||||||
{{/* http://nginx.org/en/docs/http/ngx_http_log_module.html#access_log */}}
|
{{/* http://nginx.org/en/docs/http/ngx_http_log_module.html#access_log */}}
|
||||||
|
|
Loading…
Reference in a new issue