title: Get application virtual base path in aspnet core
body: <p>I know that is located in <code>HttpContext.Request.PathBase</code>, however I need it to configure my cookie before I have any <code>HttpContext</code> (in <code>Startup.cs</code>).</p>
  
  <p>My problem:</p>
  
  <p>When devops configure application they have to set path twice. Once in IIS application (so hosting knows what should be served) and in my appsettings.json (so application knows where to set cookies - multiple instances can work on server). I would like to configure it once in IIS, and have config passed to my application.</p>