title: nginx variables are empty when using custom log format
body: <p>I'm trying to implement a custom log format for my access logs in nginx. I specified my <code>log_format</code> and <code>access_log</code> in the nginx.conf:</p>
  
  <pre><code>http {
  
      log_format myformat '$remote_addr - $remote_user [$time_local] '
          '"$request" $status $body_bytes_sent '
          '"$http_referer" "$http_user_agent"';
  
      server {
          access_log /var/log/nginx/access.log myformat;
          ...
      }
  }
  </code></pre>
  
  <p>The logs are indeed written to the correct file, but all variables seem to be empty. The file looks like that:</p>
  
  <pre><code>-  [] ""   "" ""
  -  [] ""   "" ""
  -  [] ""   "" ""
  </code></pre>
  
  <p>If I don't specify the custom log format, everything is working perfectly fine, this is what the log file looks like:</p>
  
  <pre><code>172.18.0.1 - - [04/Jul/2018:09:28:27 +0000] "GET / HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Firefox/60.0"
  172.18.0.1 - - [04/Jul/2018:09:28:28 +0000] "GET / HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Firefox/60.0"
  </code></pre>
  
  <p>Does anyone have a hint what the problem could be there?</p>