The extension that utilizes either X-Sendfile for Apache or X-Accel-Redirect for Nginx when downloading files.


The XsendFile module utilizes either X-Sendfile for Apache or X-Accel-Redirect for Nginx when downloading files. It is used for downloadable products when customers start downloading a product. The extension sends X-Sendfile headers for Apache web servers or X-Accel-Redirects for Nginx web servers. X-accel allows for internal redirection to a location determined by a header returned from a backend.

This allows you to handle authentication, logging, or whatever else you please in your backend and then have NGINX handle serving the contents from the redirected location to the end-user, thus freeing up the backend to handle other requests. This feature is commonly known as X-Sendfile. You can find out more information about the XSendfile feature in the Nginx documentation.


  • Ability to choose server type from the admin
  • Header sent automatically when a customer downloads the file of downloadable product
  • Ability to specify path for downloaded files outside of Magento folder
  • Improved security for file downloads
  • Supports Nginx & Apache web servers
More Information
Magento Compatibility 2.3.x, 2.4.x
License GNU General Public License v3.0 (GPL-3.0)
Composer Package thesgroup/module-xsendfile

Automatically Add The Repository

Through an SSH connection, all you have to do is run the following command from your Magento installation directory

composer config repositories.www.sashas.org composer https://www.sashas.org

Manually Add The Repository

The typical Magento 2 installation has repositories section of composer.json like this:

                "repositories": [
                        "type": "composer",
                        "url": "https://repo.magento.com/"

You will need to add a repository by appending an object to the repositories object

                "repositories": {
                    "0": {
                        "type": "composer",
                        "url": "https://repo.magento.com/"
                    "www.sashas.org": {
                        "type": "composer",
                        "url": "https://www.sashas.org"

How To Install The Module

Once the repository is added to the composer.json file, you can now install the packages that are available through it.

For example, let’s say you want to install the thesgroup/module-xsendfile module through composer. Run the command below to install it:

composer require thesgroup/module-xsendfile
Write Your Own Review
Only registered users can write reviews. Please Sign in or create an account