Search code examples
iisgo

Run go web application on IIS


Is there a way to run Go web application on IIS?
I found a setting for azure but its not working on my dev machine
this is a web config for azure :

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <handlers>
            <add name="httpplatformhandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" />
        </handlers>
        <httpPlatform processPath="d:\home\site\wwwroot\go\bin\go.exe" 
                      arguments="run d:\home\site\wwwroot\server.go" 
                      startupTimeLimit="60">
            <environmentVariables>
              <environmentVariable name="GOROOT" value="d:\home\site\wwwroot\go" />
            </environmentVariables>
        </httpPlatform>
    </system.webServer>
</configuration>

Solution

  • Your local IIS does not work simply because you need to install a separate component, called HttpPlatformHandler module.

    Reverse proxy or FastCGI were the older approaches which are no longer necessary with this new approach.

    I wrote a post with examples and troubleshooting tips to show how things can work together.

    About why you shouldn't use ASP.NET Core module, you can read the history here.