Two things are actually required. First we need to redirect access.log to /dev/stdout and error.log to /dev/stderr. An easy way to do it in docker is by aliasing the nginx logs to stdout and stderr. We can do it by adding this to our Dockerfile :
RUN ln -sf /dev/stdout /var/log/nginx/access.log \
&& ln -sf /dev/stderr /var/log/nginx/error.log
However this is not sufficient, because supervisor capture output of processes it manages. Nginx logs now ends up in /var/logs/supervisor/nginx-*.log.
We need to tell supervisor to redirect logs it captures to /dev/stdout.
command=nginx -g ‘daemon off;’
We can now run docker-compose up and watch nginx output