有没有办法在IIS上运行Go Web应用程序? 我找到了azure的设置,但是它在我的开发机器上不起作用, 这是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>
您的本地IIS无法正常运行,因为您需要安装一个名为HttpPlatformHandler模块的单独组件,
https://azure.microsoft.com/zh-CN/blog/announcing-the-release-of-the- httpplatformhandler-module-for-iis-8/
http://www.iis.net/downloads/microsoft/httpplatformhandler
反向代理或FastCGI是较旧的方法,此新方法不再需要。