title: Rails not serving my robots.txt and sitemap.xml.gz on Production
body: <p>While these files are being served in development fine, and also in production on my local machine, these are not served on live production. I get a 404 not found error. Everything else is working fine. These files are present in the public directory of the app (-approot-/public)</p>
  
  <p>I am using <code>nginx</code> and <code>unicorn</code> over the live server. My <code>nginx/sites-available/default</code> file:</p>
  
  <pre><code>upstream example.com {
   server unix:/tmp/example.socket fail_timeout=0;
  }
  
  server {
    listen 80 default;
    server_name example.com www.example.com;
    root /home/myuser/apps/example/current/public;
    access_log /var/log/nginx/access.log;
    rewrite_log on;
  
    location / {
      proxy_pass  http://example.com;
      proxy_redirect     off;
      proxy_set_header   Host             $host;
      proxy_set_header   X-Real-IP        $remote_addr;
      proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
  
      client_max_body_size       10m;
      client_body_buffer_size    128k;
  
      proxy_connect_timeout      90;
      proxy_send_timeout         90;
      proxy_read_timeout         90;
  
      proxy_buffer_size          4k;
      proxy_buffers              4 32k;
      proxy_busy_buffers_size    64k;
      proxy_temp_file_write_size 64k;
     }
  
    location ~ ^/(images|javascripts|stylesheets|assets|system)/  {
      root /home/myuser/apps/example/current/public;
      expires max;
      break;
     }
  
  }
  </code></pre>