Making auth access logs optional (#10335)
This commit is contained in:
parent
1ce25127bd
commit
93f9ac2521
2 changed files with 7 additions and 0 deletions
|
@ -131,6 +131,10 @@ type Configuration struct {
|
||||||
// By default this is disabled
|
// By default this is disabled
|
||||||
EnableAccessLogForDefaultBackend bool `json:"enable-access-log-for-default-backend"`
|
EnableAccessLogForDefaultBackend bool `json:"enable-access-log-for-default-backend"`
|
||||||
|
|
||||||
|
// EnableAuthAccessLog enable auth access log
|
||||||
|
// By default this is disabled
|
||||||
|
EnableAuthAccessLog bool `json:"enable-auth-access-log"`
|
||||||
|
|
||||||
// AccessLogPath sets the path of the access logs for both http and stream contexts if enabled
|
// AccessLogPath sets the path of the access logs for both http and stream contexts if enabled
|
||||||
// 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
|
||||||
// http://nginx.org/en/docs/stream/ngx_stream_log_module.html#access_log
|
// http://nginx.org/en/docs/stream/ngx_stream_log_module.html#access_log
|
||||||
|
@ -871,6 +875,7 @@ func NewDefault() Configuration {
|
||||||
AccessLogPath: "/var/log/nginx/access.log",
|
AccessLogPath: "/var/log/nginx/access.log",
|
||||||
AccessLogParams: "",
|
AccessLogParams: "",
|
||||||
EnableAccessLogForDefaultBackend: false,
|
EnableAccessLogForDefaultBackend: false,
|
||||||
|
EnableAuthAccessLog: false,
|
||||||
WorkerCPUAffinity: "",
|
WorkerCPUAffinity: "",
|
||||||
ErrorLogPath: "/var/log/nginx/error.log",
|
ErrorLogPath: "/var/log/nginx/error.log",
|
||||||
BlockCIDRs: defBlockEntity,
|
BlockCIDRs: defBlockEntity,
|
||||||
|
|
|
@ -1102,7 +1102,9 @@ stream {
|
||||||
opentelemetry_propagate;
|
opentelemetry_propagate;
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
{{ if not $all.Cfg.EnableAuthAccessLog }}
|
||||||
access_log off;
|
access_log off;
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
# Ensure that modsecurity will not run on an internal location as this is not accessible from outside
|
# Ensure that modsecurity will not run on an internal location as this is not accessible from outside
|
||||||
{{ if $all.Cfg.EnableModsecurity }}
|
{{ if $all.Cfg.EnableModsecurity }}
|
||||||
|
|
Loading…
Reference in a new issue