Skip to content

meta-it/IIS-X-Sendfile-plugin

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Provides X-Sendfile functionality for IIS7.x

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%