nginx configuration snippet to illustrate how to serve single file.

Serve statistics.csv file from /var/www/statistics/ directory for <a href="http://127.0.0.1:7000/statistics;csv;norefresh" rel="nofollow">http://127.0.0.1:7000/statistics;csv;norefresh</a> address, protect it using basic authentication and deny anything else.

server {
  listen 127.0.0.1:7000;
  root /var/www/statistics;
  location "/statistics;csv;norefresh" {
    auth_basic "Statistics";
    auth_basic_user_file /etc/nginx/snippets/statistics.htpasswd;
    try_files /statistics.csv =404;
  }
  location / {
    deny all;
  }
}

Simple as that.