title: How to configure Nginx to return a CSV as response?
body: <p>I have a <code>test.csv</code> file locate at the root of my VM running on Ubuntu. 
  I am using <code>Nginx</code> in <code>Laravel 4.2</code>. </p>
  
  <p><a href="https://i.stack.imgur.com/F2mIu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/F2mIu.png" alt="enter image description here"></a></p>
  
  <ul>
  <li>VM IP : <code>1.1.1.1</code> </li>
  <li>Domain : <code>www.site.com</code> </li>
  </ul>
  
  <p>How do I make that CSV public accessible via my site: <code>www.site.com/csv</code>  ? </p>
  
  <p><strong>nginx</strong></p>
  
  <pre><code>server {
  
      listen 80 default_server;
      server_name site.com www.site.com;
      root /home/forge/john/public;
  
      ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
      index index.html index.htm index.php;
      charset utf-8;
  
      location /nginx_status {
          stub_status on;
          access_log off;
          allow 127.0.0.1;
          deny all;
      }
  
      location /resume {
          #auth_basic "Restricted";
          #auth_basic_user_file /home/forge/john/.htpasswd;
          try_files $uri $uri/ /index.php?$query_string;
      }
  
      location /getIconBasedOnDevicesName {
          proxy_pass http://localhost:3030;
          proxy_http_version 1.1;
          proxy_set_header Upgrade $http_upgrade;
          proxy_set_header Connection 'upgrade';
          proxy_set_header Host $host;
          proxy_cache_bypass $http_upgrade;
      }
  
      location / {
          try_files $uri $uri/ /index.php?$query_string;
      }
  
      location = /favicon.ico { access_log off; log_not_found off; }
      location = /robots.txt  { access_log off; log_not_found off; }
  
      access_log off;
      error_log  /var/log/nginx/default-error.log error;
  
      error_page 404 /index.php;
  
      location ~ \.php$ {
          fastcgi_split_path_info ^(.+\.php)(/.+)$;
          fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
          fastcgi_index index.php;
          include fastcgi_params;
      }
  
      location ~ /\.ht {
          deny all;
      }
  
  }
  </code></pre>