title: Nginx docker (13: Permission denied) while logging request to mounted volume
body: <p>I am using nginx version: nginx/1.11.8</p>
  
  <p>My docker file looks like:</p>
  
  <pre><code>FROM nginx
  COPY website /usr/share/nginx/html/website/
  RUN chown -R nginx /usr/share/nginx/html
  RUN chown -R nginx /var/log/nginx/
  EXPOSE 80
  </code></pre>
  
  <p>I am using variables for my access log names as shown below.  When running without mounting to a directory on the host machine this works fine and the logs are produced.</p>
  
  <pre><code>location / {
    try_files $uri /index.html;
    if ($time_iso8601 ~ "^(\d{4})-(\d{2})-(\d{2})") { set $year $1; set $month $2; set $day $3; }
    access_log /var/log/nginx/nginx.$hostname.$year-$month-$day.log logs;
  }
  </code></pre>
  
  <p>My host log directory is owner:steve group:logs</p>
  
  <p>if i remove the variables from the access log name then it logs correctly to the host directory i.e </p>
  
  <pre><code>access_log /var/log/nginx/nginx.novars.log logs;
  </code></pre>
  
  <p>Am i missing something glaringly obvious to get this to work using variables ?</p>