title: Nginx ssl serves different index file
body: <p>I've set up letsencrypt and but for some reason it serves the wrong index file.
  The http url gives the correct file. But the https gives a wrong file.</p>
  
  <pre><code>/etc/nginx/sites-available/default
  
  server {
      listen 80 default_server;
      listen [::]:80 default_server;
  
      root /var/www/html;
  
      # Add index.php to the list if you are using PHP
      #index index.php index.html index.htm index.nginx-debian.html;
      index index.php index.html index.htm;
  
      server_name _;
  
      location / {
          # First attempt to serve request as file, then
          # as directory, then fall back to displaying a 404.
          try_files $uri $uri/ =404;
      }
  
      location ~ \.php$ {
          include snippets/fastcgi-php.conf;
          fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
      }
  
      location /.well-known/acme-challenge {
          root /var/www/letsencrypt;
      }
  }
  server {
      listen  443 ssl;
      server_name EXAMPLE.COM;
  
      ssl_certificate /etc/letsencrypt/live/EXAMPLE.COM/cert.pem;
      ssl_certificate_key /etc/letsencrypt/live/EXAMPLE.COM/privkey.pem;
  
  }
  </code></pre>
  
  <p>The file is a default "Welcome to nginx on Debian!" It waslocated <code>/var/www/html/index.nginx-debian.html</code>
  But even when I change the files content the https will still display the old content. Rebooting doesn't help.</p>
  
  <p>And after changing I tried to search where the file does display.</p>
  
  <pre><code>sudo grep 'Welcome to nginx on Debian' -nir
  </code></pre>
  
  <p>Nothing, because I changed the file.</p>
  
  <p>I removed the file from the index.</p>
  
  <pre><code>#index index.php index.html index.htm index.nginx-debian.html;
  index index.php index.html index.htm;
  </code></pre>
  
  <p>After a reboot still nothing. (I know I can reload nginx, but I want to be sure)</p>
  
  <p>I know it probably will be fixed if I set the webroot and index to the ssl server block. But I want to know how this can serve a file which I can't find anywhere.</p>
  
  <p>Where does Nginx get this file from?</p>