title: Nginx Docker Volumes empty
body: <p>When using docker-compose, nginx isn't showing files like other images might.</p>
  
  <p>For example with Mysql, the below code will save the data created at <code>/var/lib/mysql</code> to the local machine at <code>./volumes/db/data</code></p>
  
  <pre><code>./volumes/db/data:/var/lib/mysql
  </code></pre>
  
  <p>Another example, with Wordpress, the below code will save the data created at <code>/var/www/html/wp-content/uploads</code> to the local machine at <code>./volumes/uploads/data</code></p>
  
  <pre><code>./volumes/uploads/data:/var/www/html/wp-content/uploads
  </code></pre>
  
  <p>This is not working with nginx though so no matter what I change <code>/some/nginx/path</code> to, it never appears at <code>./volumes/nginx/data</code></p>
  
  <pre><code>./volumes/nginx/data:/some/nginx/path
  </code></pre>
  
  <p>Does nginx work differently in this regard? </p>
  
  <hr>
  
  <h2>Update</h2>
  
  <p>Using a named volume with the following configurations solved this problem:</p>
  
  <ul>
  <li><p>In the <code>services</code> section of the docker-compose file, I changed <code>./volumes/nginx/data:/some/nginx/path</code> to <code>nginx_data:/some/nginx/path</code></p></li>
  <li><p>And then my <code>volumes</code> section reads as follows</p></li>
  </ul>
  
  <hr>
  
  <pre><code>volumes:
    nginx_data:
      driver: local
      driver_opts:
        o: bind
        device: ${PWD}/volumes/nginx/data
  </code></pre>