Add support for access-log-path and error-log-path

This commit is contained in:
Max Laverse 2017-08-23 16:57:28 +02:00
parent e7d2ff6fac
commit dd00b6d7b3
4 changed files with 24 additions and 4 deletions

View file

@ -118,9 +118,9 @@ http {
{{ if $cfg.DisableAccessLog }}
access_log off;
{{ else }}
access_log /var/log/nginx/access.log upstreaminfo if=$loggable;
access_log {{ $cfg.AccessLogPath }} upstreaminfo if=$loggable;
{{ end }}
error_log /var/log/nginx/error.log {{ $cfg.ErrorLogLevel }};
error_log {{ $cfg.ErrorLogPath }} {{ $cfg.ErrorLogLevel }};
{{ buildResolvers $cfg.Resolver }}
@ -417,10 +417,10 @@ stream {
{{ if $cfg.DisableAccessLog }}
access_log off;
{{ else }}
access_log /var/log/nginx/access.log log_stream;
access_log {{ $cfg.AccessLogPath }} log_stream;
{{ end }}
error_log /var/log/nginx/error.log;
error_log {{ $cfg.ErrorLogPath }};
# TCP services
{{ range $i, $tcpServer := .TCPBackends }}