我想使用 iis 作为我的 asp.net core 1.x 应用程序的反向代理,并且可以在服务器中使用http://localhost:5000 url,并且可以在 Internet 上使用http://example.com 但是有是一个让我做不到的问题。这是program.cs:
public static void Main(string[] args)
{
var host = new WebHostBuilder()
.CaptureStartupErrors(true)
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseUrls("http://localhost:5000/")
.UseIISIntegration()
.UseStartup<Startup>()
.UseApplicationInsights()
.Build();
host.Run();
}
这是我的 web.config:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<remove name="aspNetCore"/>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified"/>
</handlers>
<aspNetCore processPath=".\exampleApp.exe" arguments=".\exampleApp.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false" />
</system.webServer>
</configuration>
我的问题是什么?为什么它不起作用?