title: WEB API 2 Self-hosted hostname issues
body: <p>I'am trying to make a self-hosted web api service. I followed a tutorial and it works fine on my local computer.</p>
  
  <p>localhost/api/values responds fine with the expected JSON.</p>
  
  <p>Now, I have a server binded to the DNS "myserver.mycompany.com". When I start my WebApi 2 service on this server and try to call myserver.mycompany.com/api/values I have a 404 page not found error.</p>
  
  <p>If I browse locally on this server and call the localhost/api/values url it works fine.</p>
  
  <p>Here is the code of the Startup class :</p>
  
  <pre><code>using Owin;
  using System.Web.Http;
  
  namespace SelfHostedWebApi2
  {
  public class Startup
  {
      // This code configures Web API. The Startup class is specified as a type
      // parameter in the WebApp.Start method.
      public void Configuration(IAppBuilder appBuilder)
      {
          // Configure Web API for self-host. 
          HttpConfiguration config = new HttpConfiguration();
          config.Routes.MapHttpRoute(
              name: "DefaultApi",
              routeTemplate: "api/{controller}/{id}",
              defaults: new { id = RouteParameter.Optional }
          );
  
          appBuilder.UseWebApi(config);
      }
  }
  }
  </code></pre>
  
  <p>And here is how I start the server :</p>
  
  <pre><code>using Microsoft.Owin.Hosting;
  using System;
  using System.Net.Http;
  
  namespace SelfHostedWebApi2 
  { 
  public class Program 
  { 
      static void Main() 
      { 
          string baseAddress = "http://localhost:80/"; 
  
          // Start OWIN host 
          try
          {
              WebApp.Start&lt;Startup&gt;(new StartOptions(url: baseAddress));
  
              HttpClient client = new HttpClient();
  
              var response = client.GetAsync(baseAddress + "api/values").Result;
  
              Console.WriteLine(response);
              Console.WriteLine(response.Content.ReadAsStringAsync().Result); 
  
          }
          catch (Exception ee)
          {
  
              Console.WriteLine("Erreur : " + ee.ToString());
          }
  
          Console.ReadLine(); 
      } 
  } 
  } 
  </code></pre>
  
  <p>Thank you for your help</p>