title: 500 Internal Server Error when hosted .net Core App in Docker
body: <p>I have created a test app in .net Core Framework and was perfectly running in a development environment.</p>
  <p>Later I published this to docker container and is perfectly working as my declared IP address with hosted are listening and I can browse it through google chrome.</p>
  <p>But when I try to consume API service I am not able to do so.  I have created to simple function to calculate the sum of two numbers.</p>
  <p>Below are my configurations</p>
  <p>Program.cs</p>
  <pre><code>public static IWebHost BuildWebHost(string[] args)
      {
          return WebHost.CreateDefaultBuilder(args)
          .UseStartup&lt;Startup&gt;()
          .UseUrls(Configuration[&quot;Hosting:https:host&quot;] + &quot;:&quot; + Configuration[&quot;Hosting:https:port&quot;], Configuration[&quot;Hosting:http:host&quot;] + &quot;:&quot; + Configuration[&quot;Hosting:http:port&quot;])
          .UseKestrel(options =&gt;
          {
              options.ListenAnyIP(int.Parse(Configuration[&quot;Hosting:https:port&quot;].ToString()), listenOptions =&gt;
                  {
              var serverCertificate = LoadCertificate();
              listenOptions.UseHttps(serverCertificate); // &lt;- Configures SSL
              });
              options.ListenAnyIP(int.Parse(Configuration[&quot;Hosting:http:port&quot;].ToString()));
  
                  //options.ListenLocalhost(5004, opts =&gt; opts.UseHttps());
                  //options.ListenLocalhost(5005, opts =&gt; opts.UseHttps());
  
  
                  //options.Listen(IPAddress.Loopback, 5000);
                  //options.ListenLocalhost(port, listenOptions =&gt;
                  //{
                  //    var serverCertificate = LoadCertificate();
                  //    listenOptions.UseHttps(serverCertificate); // &lt;- Configures SSL
                  //});
              })
          .UseSerilog()
          .Build();
      }
  </code></pre>