Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Provides X-Sendfile functionality for IIS7.x

branch: master
README.textile

X-Sendfile and X-Accel-Redirect Support for IIS 7.x

This module provides basic support for X-Sendfile and X-Accel-Redirect headers.

Usage

Either compile again for the target .net environment or use the supplied .net 4 dll
For more details on what the below settings mean and do, please consult Apache or NGinx documentation

Install the DLL

  • Copy the assembly compiled to the /BIN directory located in the root of your application.
    • If this directory does not exist, create it.
  • Configure the module and handler to be loaded in the application.
    • Open the IIS7 Administration tool
    • double-click on your server node in the left-hand tree view, then expand the “Sites” node, and click on the site or application to which you would like to add your module and handler.
      • Select the “Modules” feature icon, then click the “Add Managed Module…” action, and in the resulting dialog box type in the module name (arbitrary) and the fully-qualified module type “XSendfile.XSendfileHttpModule”.
      • Press OK to add the module.

Select one of the optional configurations below:

Config the base directory if using X-Sendfile (optional)

  1. Open the IIS manager
  2. Select your web application
  3. Double click application settings
    • Click add…
    • name: XSendDir
    • value (for example): c:\inetpub\private

Config location if using X-Accel-Redirect (optional)

  1. Open the IIS manager
  2. Select your web application
  3. Double click application settings
    • Click add…
      • name: XAccelLocation
      • value (for example): /virtual/path
    • Click add…
      • name: XAccelRoot
      • value (for example): c:/base/dir

Common Settings

  • XSendCache: [NoCache|Private|Public] (defaults to NoCache)
  • XSendMime: False (defaults to null)
    • If this setting is not set then the mime type will be set using your IIS site mime settings
    • Setting this to false means the Content-Type header needs to be set by your application

Ensure IIS has access

  • Make sure the directory exists
  • You can run the following command to provide the IIS User read/write access
    • icacls c:\inetpub\private /grant BUILTIN\IIS_IUSRS:RW
Something went wrong with that request. Please try again.