How can I avoid users from downloading a big file?

I think, that You can configure nginx to check specific location (60gb file location) for specific (Range) header existence. Then You could block requests that don't contain Range header.

You could check these links:

https://stackoverflow.com/questions/18970620/nginx-reject-request-if-header-is-not-present-or-wrong

https://stackoverflow.com/questions/35342049/nginx-reject-request-if-header-not-present/35366796

Edit

It seems a bit problematic coding complex conditions in Nginx configuration. Maybe You should consider serving large file using some server-side scripting, ie. PHP. There are plenty of examples of streaming scripts.

https://gist.github.com/ranacseruet/9826293

After configuring Nginx to using such a script, You need to add logic to script (Range conditions) and also prevent direct access to large file.

Tags:

Nginx

Http