title: Error reading CSV served by nginx
body: <p>I am using <code>com.opencsv.CSVReader</code> to read a CSV from a URL served by my nginx Web server. The CSV file content is exactly this:</p>
  
  <p><code>0.999,1.399,1.799,2.199,2.599,2.999,3.399,3.799,4.199,4.599,4.999,5.399</code></p>
  
  <p>The problem is that when I read the file I get no csv values:</p>
  
  <pre><code>try (InputStreamReader in = new InputStreamReader(new URL(...csv).openStream(), "UTF-8"); CSVReader r = new CSVReader(in)) {
  
    List&lt;String[]&gt; csv = r.readAll();
    ....
  </code></pre>
  
  <p>After this point, csv has failed to get the data (but no errors are raised), and <code>csv.get(0).length</code> is incorrectly <code>1</code>, an empty string. I do not know why. Tests that I have done to isolate the problem:</p>
  
  <ul>
  <li>I have tried obtaining the file via http and https from my nginx with similar results. I must say that this code was working fine not too long ago, and with no apparent reason now it is failing.</li>
  <li><p>I have used a <code>BufferedReader</code> to see what was in <code>in</code> before reading the csv and I got:</p>
  
  <pre><code>Date: Fri, 10 Aug 2018 03:11:13 GMT
  Content-Type: text/plain
  Content-Length: 71
  Last-Modified: Wed, 12 Jul 2017 16:23:24 GMT
  Connection: keep-alive
  ETag: "..."
  Strict-Transport-Security: max-age=31536000
  X-Frame-Options: DENY
  X-Content-Type-Options: nosniff
  X-XSS-Protection: 1; mode=block
  Accept-Ranges: bytes
  
  0.999,1.399,1.799,2.199,2.599,2.999,3.399,3.799,4.199,4.599,4.999,5.399
  </code></pre>
  
  <p>So I am not sure if the headers were also read by the csv reader and messed with it somehow.</p></li>
  <li><p>I have used the same code to access an external CSV instead of the one served by my nginx and it worked fine, and the test using the <code>BufferedReader</code> with the external CSV did not show any header, just the csv values.</p></li>
  </ul>
  
  <p>That is why I am also considering that it could be an nginx problem, since I also experienced a recent error of files not finishing download and I had to change my previous <code>keepalive_timeout 65</code> that was working fine to <code>keepalive_timeout 0</code>. I am not sure why this happened all of a sudden.</p>