Skip to content

Instantly share code, notes, and snippets.

@leodc
Created November 21, 2019 00:17
Show Gist options
  • Save leodc/eb20ec9cdbe3db66fcf54b2df983ffa5 to your computer and use it in GitHub Desktop.
Save leodc/eb20ec9cdbe3db66fcf54b2df983ffa5 to your computer and use it in GitHub Desktop.
NGINX config to download files
server {
listen 80;
server_name default_server;
location ~ ^.*/(?P<request_basename>[^/]+\.(csv))$ {
root /www/data/;
add_header Content-Disposition 'attachment; filename="$request_basename"';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment