title: Nginx Cache-Control header not working (getting 404 on logs)
body: <p>I'm trying to setup nginx to cache static files, such as images, css and js.</p>
  
  <p>This is my conf.</p>
  
  <pre><code>server {
      listen       80;
      server_name  localhost;
  
      #charset koi8-r;
      #access_log  /var/log/nginx/log/host.access.log  main;
  
      location / {
          root   /var/www/site;
          index  index.html index.htm;
    }
  
          location ~* \.(?:ico|css|js|gif|jpe?g|png)$ {
                  expires max;
                  add_header Pragma public;
                  add_header Cache-Control "public, must-revalidate, proxy-revalidate";
          }
  
  #error_page  404              /404.html;
  
  # redirect server error pages to the static page /50x.html
  #
  error_page   500 502 503 504  /50x.html;
  location = /50x.html {
      root   /usr/share/nginx/html;
  }
  }
  </code></pre>
  
  <p>When I try to to use this I get 404 on all files, when I remove the location ~*... I can retrieve all files perfectly. I have my files in <code>/var/www/site/images/*/*.jpg</code>. What am I missing here?</p>