HTTP Platform Handler¶
In ASP.NET 5, the web application is hosted by an external process outside of IIS. The HTTP Platform Handler is an IIS 7.5+ module which is responsible for process management of http listeners and to proxy requests to processes that it manages. This document provides an overview of how to configure the HTTP Platform Handler module for shared hosting of ASP.NET 5.
Installing the HTTP Platform Handler¶
To get started with hosting with ASP.NET 5 applications you will need to install the HTTP Platform Handler version 1.2 or higher on an IIS 7.5 or higher server. Download links are below
Configuring the HTTP Platform Handler¶
The HTTP Platform Handler is configured via a site or application’s web.config file and has its own configuration section within
system.webServer - httpPlatform. The HTTP Platform Handler configuration reference whitepaper describes in detail how to modify Configuration Attributes for the HTTP PlatformHandler module.
You may need to unlock the handlers section of web.config. Follow the instructions here.
The HTTP Platform Handler module can redirect
stderr logs to disk by setting the
stdoutLogFile properties of the
httpPlatform attribute. However, the HTTP Platform Handler module does not rotate logs and it is the responsibilty of the hoster to limit the disk space the logs consume.
<httpPlatform processPath="..\approot\web.cmd" arguments="" stdoutLogEnabled="true" stdoutLogFile="..\logs\stdout" startupTimeLimit="3600"> </httpPlatform>
Setting Environment Variables¶
The HTTP Platform Handler module allows you specify environment variables for the process specified in the
processPath setting by specifying them in
environmentVariables child attribute to the
httpPlatform attribute. The example below illustrates how you would use it.
<httpPlatform processPath="..\approot\web.cmd" arguments="" stdoutLogEnabled="true" stdoutLogFile="..\logs\stdout" startupTimeLimit="3600"> <environmentVariables> <environmentVariable name="DEMO" value="demo_value" /> </environmentVariables> </httpPlatform>
There is a known issue known issue with
dnu publish where it removes all child attributes of the