We've got a lot (50,000+) of attachments on our forum and Xsendfile/X-accel was recommended. Can any proficient nginx users here verify the below is working as intended? We're trying to optimize attachment handling without breaking view counters or removing permissions. http://wiki.nginx.org/X-accel I have tested this in /XenForo/ViewPublic/Attachment/View.php PHP: return new XenForo_FileOutput($this->_params['attachmentFile']); replaced with PHP: $this->_response->setHeader('X-Accel-Redirect', str_replace(XenForo_Application::getInstance()->getRootDir(),'', $this->_params['attachmentFile']));return ''; So in theory nginx is doing all the work now? I'm wondering would this also require a defined internal location aka into /internal_data folder etc on the nginx config side.