iis as a reverse proxy server for kestrel

Viewed 1071

I want to use iis to be reverse proxy for my asp.net core 1.x application and available whit http://localhost:5000 url in the server and it be available on the Internet with http://example.com But there is a problem that makes I can not do it. It's 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();

    }

and it's my 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>

What is my problem?Why it doesn't work?

0 Answers
Related