HTTP Platform Handler

By Sourabh Shirhatti

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.

Note

You may need to unlock the handlers section of web.config. Follow the instructions here.

Log Redirection

The HTTP Platform Handler module can redirect stdout and stderr logs to disk by setting the stdoutLogEnabled and 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>

Note

There is a known issue known issue with dnu publish where it removes all child attributes of the httpPlatform attribute.