It is possible to let Nginx handle static file serving via X-Accel-Redirect. This dramatically increases performance for 'local' and 'direct' file storage, shifting the download process away from PHP and onto Nginx.
Documentation can be found in the Nginx Wiki section Mod X-Sendfile and section X-Accell. The header used by Nginx is X-Accel-Redirect.
X-Accel-Redirect is supported by default in Nginx and no additional operation should be needed to install it.
Configuration of X-Accel-Redirect for Nginx is below. In /etc/nginx/conf.d/default.conf add:
location ~ \.php$ { fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED on; } location /files { root /root/path/to/yetishare; internal; }
Login to your admin area, go to 'file servers' navigation, click 'edit' on the relevant file server. Scroll to the 'Improved Downloads' option and select 'X-Accel-Redirect'.