diff --git a/setup/start.sh b/setup/start.sh index 53b5337dd..f97364c1d 100755 --- a/setup/start.sh +++ b/setup/start.sh @@ -85,6 +85,9 @@ systemctl daemon-reload systemctl restart systemd-journald setfacl -n -m u:${USER}:r /var/log/journal/*/system.journal +# Give user access to nginx logs (uses adm group) +usermod -a -G adm ${USER} + echo "==> Setting up unbound" # DO uses Google nameservers by default. This causes RBL queries to fail (host 2.0.0.127.zen.spamhaus.org) # We do not use dnsmasq because it is not a recursive resolver and defaults to the value in the interfaces file (which is Google DNS!) diff --git a/src/addons.js b/src/addons.js index e3b836c36..b4d34c812 100644 --- a/src/addons.js +++ b/src/addons.js @@ -506,6 +506,13 @@ function getServiceLogs(id, options, callback) { args.push('--output=short-iso'); if (follow) args.push('--follow'); + } else if (name === 'nginx') { + cmd = '/usr/bin/tail'; + + args.push('--lines=' + (lines === -1 ? '+1' : lines)); + if (follow) args.push('--follow', '--retry', '--quiet'); // same as -F. to make it work if file doesn't exist, --quiet to not output file headers, which are no logs + args.push('/var/log/nginx/access.log'); + args.push('/var/log/nginx/error.log'); } else { cmd = '/usr/bin/tail';