title: iis 7.5 dns windows authentication page user identity not working
body: <p>In IIS 7.5 server I have a website apps.mydomain.com.  Site binding for this website is:</p>
  
  <p>IP: All Unassigned</p>
  
  <p>Port: 80</p>
  
  <p>Host name: apps.mydomain.com</p>
  
  <p>In DNS there is an ip address pointing to apps.mydomain.com. Site comes up fine when browsing to this hostname.  </p>
  
  <p>I want to get current windows logged in username from asp.net web apps. I enabled windows authentication and disabled anonymous. Using this ASP.Net code to test:</p>
  
  <pre><code>Response.Write(Page.User.Identity.Name);
  </code></pre>
  
  <p>However, browsing to <a href="http://apps.mydomain.com/site/" rel="nofollow">http://apps.mydomain.com/site/</a> the application pool identity shows as the Page.User.Identity.Name value and not the current windows logged in username.</p>
  
  <p>If I browse to <a href="http://servername/site/" rel="nofollow">http://servername/site/</a> then Page.User.Identity.Name will return current windows logged in username.</p>
  
  <p>Is there something else I need to configure to get the current windows logged in username when using host header?</p>
  
  <p>web.config:</p>
  
  <pre><code>    &lt;?xml version="1.0"?&gt;
  &lt;configuration&gt;
      &lt;system.web&gt;
          &lt;authentication mode="Windows"/&gt;
      &lt;/system.web&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>App pool config (left out "handlers" for brevity, there's a 30000 char limit):</p>
  
  <p>
  
      
          
              
              
              
              
              
              
              
              
          </p>
  
  <pre><code>    &lt;sectionGroup name="system.webServer"&gt;
          &lt;section name="asp" overrideModeDefault="Deny" /&gt;
          &lt;section name="caching" overrideModeDefault="Allow" /&gt;
          &lt;section name="cgi" overrideModeDefault="Deny" /&gt;
          &lt;section name="defaultDocument" overrideModeDefault="Allow" /&gt;
          &lt;section name="directoryBrowse" overrideModeDefault="Allow" /&gt;
          &lt;section name="fastCgi" allowDefinition="AppHostOnly" overrideModeDefault="Deny" /&gt;
          &lt;section name="globalModules" allowDefinition="AppHostOnly" overrideModeDefault="Deny" /&gt;
          &lt;section name="handlers" overrideModeDefault="Deny" /&gt;
          &lt;section name="httpCompression" allowDefinition="AppHostOnly" overrideModeDefault="Deny" /&gt;
          &lt;section name="httpErrors" overrideModeDefault="Allow" /&gt;
          &lt;section name="httpLogging" overrideModeDefault="Deny" /&gt;
          &lt;section name="httpProtocol" overrideModeDefault="Allow" /&gt;
          &lt;section name="httpRedirect" overrideModeDefault="Allow" /&gt;
          &lt;section name="httpTracing" overrideModeDefault="Deny" /&gt;
          &lt;section name="isapiFilters" allowDefinition="MachineToApplication" overrideModeDefault="Deny" /&gt;
          &lt;section name="modules" allowDefinition="MachineToApplication" overrideModeDefault="Deny" /&gt;
          &lt;section name="odbcLogging" overrideModeDefault="Deny" /&gt;
          &lt;sectionGroup name="security"&gt;
              &lt;section name="access" overrideModeDefault="Deny" /&gt;
              &lt;section name="applicationDependencies" overrideModeDefault="Deny" /&gt;
              &lt;sectionGroup name="authentication"&gt;
                  &lt;section name="anonymousAuthentication" overrideModeDefault="Deny" /&gt;
                  &lt;section name="basicAuthentication" overrideModeDefault="Deny" /&gt;
                  &lt;section name="clientCertificateMappingAuthentication" overrideModeDefault="Deny" /&gt;
                  &lt;section name="digestAuthentication" overrideModeDefault="Deny" /&gt;
                  &lt;section name="iisClientCertificateMappingAuthentication" overrideModeDefault="Deny" /&gt;
                  &lt;section name="windowsAuthentication" overrideModeDefault="Deny" /&gt;
              &lt;/sectionGroup&gt;
              &lt;section name="authorization" overrideModeDefault="Allow" /&gt;
              &lt;section name="ipSecurity" overrideModeDefault="Deny" /&gt;
              &lt;section name="isapiCgiRestriction" allowDefinition="AppHostOnly" overrideModeDefault="Deny" /&gt;
              &lt;section name="requestFiltering" overrideModeDefault="Allow" /&gt;
          &lt;/sectionGroup&gt;
          &lt;section name="serverRuntime" overrideModeDefault="Deny" /&gt;
          &lt;section name="serverSideInclude" overrideModeDefault="Deny" /&gt;
          &lt;section name="staticContent" overrideModeDefault="Allow" /&gt;
          &lt;sectionGroup name="tracing"&gt;
              &lt;section name="traceFailedRequests" overrideModeDefault="Allow" /&gt;
              &lt;section name="traceProviderDefinitions" overrideModeDefault="Deny" /&gt;
          &lt;/sectionGroup&gt;
          &lt;section name="urlCompression" overrideModeDefault="Allow" /&gt;
          &lt;section name="validation" overrideModeDefault="Allow" /&gt;
          &lt;sectionGroup name="webdav"&gt;
              &lt;section name="globalSettings" overrideModeDefault="Deny" /&gt;
              &lt;section name="authoring" overrideModeDefault="Deny" /&gt;
              &lt;section name="authoringRules" overrideModeDefault="Deny" /&gt;
          &lt;/sectionGroup&gt;
      &lt;/sectionGroup&gt;
      &lt;sectionGroup name="system.ftpServer"&gt;
          &lt;section name="log" overrideModeDefault="Deny" allowDefinition="AppHostOnly" /&gt;
          &lt;section name="firewallSupport" overrideModeDefault="Deny" allowDefinition="AppHostOnly" /&gt;
          &lt;section name="caching" overrideModeDefault="Deny" allowDefinition="AppHostOnly" /&gt;
          &lt;section name="providerDefinitions" overrideModeDefault="Deny" /&gt;
          &lt;sectionGroup name="security"&gt;
              &lt;section name="ipSecurity" overrideModeDefault="Deny" /&gt;
              &lt;section name="requestFiltering" overrideModeDefault="Deny" /&gt;
              &lt;section name="authorization" overrideModeDefault="Deny" /&gt;
          &lt;/sectionGroup&gt;
          &lt;section name="serverRuntime" overrideModeDefault="Deny" allowDefinition="AppHostOnly" /&gt;
      &lt;/sectionGroup&gt;
  &lt;/configSections&gt;
  
  &lt;configProtectedData&gt;
      &lt;providers&gt;
          &lt;add name="IISWASOnlyRsaProvider" type="" description="Uses RsaCryptoServiceProvider to encrypt and decrypt" keyContainerName="iisWasKey" cspProviderName="" useMachineContainer="true" useOAEP="false" /&gt;
          &lt;add name="AesProvider" type="Microsoft.ApplicationHost.AesProtectedConfigurationProvider" description="Uses an AES session key to encrypt and decrypt" keyContainerName="iisConfigurationKey" cspProviderName="" useOAEP="false" useMachineContainer="true" sessionKey="AQIAAA5mAAAApAAAGvGl78LKqlTFEdnH/kqoKL6P2gWJP1j89yxhxFD1wpbaE9Y6eMLhitoa2hmeMe41BWRQw/hdv2m9RkX9cFS0UwwlcpSBAgy59xZNmPm0TKg0QcRZ6Pbx4NZdOZ5nflNugABheZbScJenA3fU0L9Ct6kx0mllufWr4SzxOtLKkHY=" /&gt;
          &lt;add name="IISWASOnlyAesProvider" type="Microsoft.ApplicationHost.AesProtectedConfigurationProvider" description="Uses an AES session key to encrypt and decrypt" keyContainerName="iisWasKey" cspProviderName="" useOAEP="false" useMachineContainer="true" sessionKey="AQIAAA5mAAAApAAApYI8BiiY8XN6fR5Ss1KzIoB31xACHhSGMMfLrWMwF1r4kh+1T3SkVS+cRbaQj1kJfPIvAv6G+Wwjot42TE0c7zrGkGaikte8dzkwp5d5U63vcc3vk2DTf/Eae4y7uHVtodFZ6gR+IEvAJZNvdyWB2rFnPT/j8T+f5/dCoeLXgnI=" /&gt;
      &lt;/providers&gt;
  &lt;/configProtectedData&gt;
  
  &lt;system.applicationHost&gt;
      &lt;sites&gt;
          &lt;site name="apps.mydomain.com" id="2" serverAutoStart="true"&gt;
              &lt;application path="/" applicationPool=".NET 2.0 Apps"&gt;
                  &lt;virtualDirectory path="/" physicalPath="C:\inetpub\wwwroot\apps" /&gt;
              &lt;/application&gt;
              &lt;application path="/test" applicationPool="test"&gt;
                  &lt;virtualDirectory path="/" physicalPath="C:\inetpub\wwwroot\apps\test" /&gt;
              &lt;/application&gt;
              &lt;bindings&gt;
                  &lt;binding protocol="http" bindingInformation="*:80:apps.mydomain.com" /&gt;
                  &lt;binding protocol="net.msmq" bindingInformation="localhost" /&gt;
                  &lt;binding protocol="net.pipe" bindingInformation="*" /&gt;
                  &lt;binding protocol="net.tcp" bindingInformation="808:*" /&gt;
                  &lt;binding protocol="msmq.formatname" bindingInformation="localhost" /&gt;
              &lt;/bindings&gt;
              &lt;traceFailedRequestsLogging enabled="false" /&gt;
          &lt;/site&gt;
          &lt;siteDefaults&gt;
              &lt;logFile logFormat="W3C" directory="%SystemDrive%\inetpub\logs\LogFiles" /&gt;
              &lt;traceFailedRequestsLogging directory="%SystemDrive%\inetpub\logs\FailedReqLogFiles" /&gt;
          &lt;/siteDefaults&gt;
          &lt;applicationDefaults applicationPool="DefaultAppPool" /&gt;
          &lt;virtualDirectoryDefaults allowSubDirConfig="true" /&gt;
      &lt;/sites&gt;
  
  &lt;/system.applicationHost&gt;
  
  &lt;system.webServer&gt;
  
      &lt;asp&gt;
          &lt;cache diskTemplateCacheDirectory="%SystemDrive%\inetpub\temp\ASP Compiled Templates" /&gt;
      &lt;/asp&gt;
  
      &lt;caching enabled="true" enableKernelCache="true"&gt;
      &lt;/caching&gt;
  
      &lt;cgi /&gt;
  
      &lt;defaultDocument enabled="true"&gt;
          &lt;files&gt;
              &lt;add value="Default.htm" /&gt;
              &lt;add value="Default.asp" /&gt;
              &lt;add value="index.htm" /&gt;
              &lt;add value="index.html" /&gt;
              &lt;add value="iisstart.htm" /&gt;
              &lt;add value="default.aspx" /&gt;
          &lt;/files&gt;
      &lt;/defaultDocument&gt;
  
      &lt;directoryBrowse enabled="false" /&gt;
  
      &lt;fastCgi /&gt;
  
      &lt;!--
  
        The &lt;globalModules&gt; section defines all native-code modules.
        To enable a module, specify it in the &lt;modules&gt; section.
  
      --&gt;
      &lt;globalModules&gt;
          &lt;add name="UriCacheModule" image="%windir%\System32\inetsrv\cachuri.dll" /&gt;
          &lt;add name="FileCacheModule" image="%windir%\System32\inetsrv\cachfile.dll" /&gt;
          &lt;add name="TokenCacheModule" image="%windir%\System32\inetsrv\cachtokn.dll" /&gt;
          &lt;add name="HttpCacheModule" image="%windir%\System32\inetsrv\cachhttp.dll" /&gt;
          &lt;add name="StaticCompressionModule" image="%windir%\System32\inetsrv\compstat.dll" /&gt;
          &lt;add name="DefaultDocumentModule" image="%windir%\System32\inetsrv\defdoc.dll" /&gt;
          &lt;add name="DirectoryListingModule" image="%windir%\System32\inetsrv\dirlist.dll" /&gt;
          &lt;add name="ProtocolSupportModule" image="%windir%\System32\inetsrv\protsup.dll" /&gt;
          &lt;add name="StaticFileModule" image="%windir%\System32\inetsrv\static.dll" /&gt;
          &lt;add name="AnonymousAuthenticationModule" image="%windir%\System32\inetsrv\authanon.dll" /&gt;
          &lt;add name="RequestFilteringModule" image="%windir%\System32\inetsrv\modrqflt.dll" /&gt;
          &lt;add name="CustomErrorModule" image="%windir%\System32\inetsrv\custerr.dll" /&gt;
          &lt;add name="HttpLoggingModule" image="%windir%\System32\inetsrv\loghttp.dll" /&gt;
          &lt;add name="RequestMonitorModule" image="%windir%\System32\inetsrv\iisreqs.dll" /&gt;
          &lt;add name="IsapiModule" image="%windir%\System32\inetsrv\isapi.dll" /&gt;
          &lt;add name="IsapiFilterModule" image="%windir%\System32\inetsrv\filter.dll" /&gt;
          &lt;add name="ConfigurationValidationModule" image="%windir%\System32\inetsrv\validcfg.dll" /&gt;
          &lt;add name="ManagedEngine64" image="%windir%\Microsoft.NET\Framework64\v2.0.50727\webengine.dll" preCondition="integratedMode,runtimeVersionv2.0,bitness64" /&gt;
          &lt;add name="ManagedEngine" image="%windir%\Microsoft.NET\Framework\v2.0.50727\webengine.dll" preCondition="integratedMode,runtimeVersionv2.0,bitness32" /&gt;
          &lt;add name="WindowsAuthenticationModule" image="%windir%\System32\inetsrv\authsspi.dll" /&gt;
          &lt;add name="ManagedEngineV4.0_32bit" image="c:\Windows\Microsoft.NET\Framework\v4.0.30319\webengine4.dll" preCondition="integratedMode,runtimeVersionv4.0,bitness32" /&gt;
          &lt;add name="ManagedEngineV4.0_64bit" image="c:\Windows\Microsoft.NET\Framework64\v4.0.30319\webengine4.dll" preCondition="integratedMode,runtimeVersionv4.0,bitness64" /&gt;
          &lt;add name="TracingModule" image="%windir%\System32\inetsrv\iisetw.dll" /&gt;
          &lt;add name="FailedRequestsTracingModule" image="%windir%\System32\inetsrv\iisfreb.dll" /&gt;
      &lt;/globalModules&gt;
  
      &lt;httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files"&gt;
          &lt;scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" /&gt;
          &lt;staticTypes&gt;
              &lt;add mimeType="text/*" enabled="true" /&gt;
              &lt;add mimeType="message/*" enabled="true" /&gt;
              &lt;add mimeType="application/x-javascript" enabled="true" /&gt;
              &lt;add mimeType="application/atom+xml" enabled="true" /&gt;
              &lt;add mimeType="application/xaml+xml" enabled="true" /&gt;
              &lt;add mimeType="*/*" enabled="false" /&gt;
          &lt;/staticTypes&gt;
      &lt;/httpCompression&gt;
  
      &lt;httpErrors lockAttributes="allowAbsolutePathsWhenDelegated,defaultPath"&gt;
          &lt;error statusCode="401" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="401.htm" /&gt;
          &lt;error statusCode="403" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="403.htm" /&gt;
          &lt;error statusCode="404" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="404.htm" /&gt;
          &lt;error statusCode="405" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="405.htm" /&gt;
          &lt;error statusCode="406" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="406.htm" /&gt;
          &lt;error statusCode="412" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="412.htm" /&gt;
          &lt;error statusCode="500" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="500.htm" /&gt;
          &lt;error statusCode="501" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="501.htm" /&gt;
          &lt;error statusCode="502" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="502.htm" /&gt;
      &lt;/httpErrors&gt;
  
      &lt;httpLogging dontLog="false" /&gt;
  
      &lt;httpProtocol&gt;
          &lt;customHeaders&gt;
              &lt;clear /&gt;
              &lt;add name="X-Powered-By" value="ASP.NET" /&gt;
          &lt;/customHeaders&gt;
          &lt;redirectHeaders&gt;
              &lt;clear /&gt;
          &lt;/redirectHeaders&gt;
      &lt;/httpProtocol&gt;
  
      &lt;httpRedirect /&gt;
  
      &lt;httpTracing&gt;
      &lt;/httpTracing&gt;
  
      &lt;isapiFilters&gt;
          &lt;filter name="ASP.Net_2.0.50727-64" path="%windir%\Microsoft.NET\Framework64\v2.0.50727\aspnet_filter.dll" enableCache="true" preCondition="bitness64,runtimeVersionv2.0" /&gt;
          &lt;filter name="ASP.Net_2.0.50727.0" path="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_filter.dll" enableCache="true" preCondition="bitness32,runtimeVersionv2.0" /&gt;
          &lt;filter name="ASP.Net_2.0_for_V1.1" path="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_filter.dll" enableCache="true" preCondition="runtimeVersionv1.1" /&gt;
          &lt;filter name="ASP.Net_4.0_64bit" path="c:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_filter.dll" enableCache="true" preCondition="runtimeVersionv4.0,bitness64" /&gt;
          &lt;filter name="ASP.Net_4.0_32bit" path="c:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_filter.dll" enableCache="true" preCondition="runtimeVersionv4.0,bitness32" /&gt;
      &lt;/isapiFilters&gt;
  
      &lt;odbcLogging /&gt;
  
      &lt;security&gt;
  
          &lt;access sslFlags="None" /&gt;
  
          &lt;applicationDependencies&gt;
              &lt;application name="Active Server Pages" groupId="ASP" /&gt;
          &lt;/applicationDependencies&gt;
  
          &lt;authentication&gt;
  
              &lt;anonymousAuthentication enabled="true" userName="IUSR" /&gt;
  
              &lt;basicAuthentication /&gt;
  
              &lt;clientCertificateMappingAuthentication /&gt;
  
              &lt;digestAuthentication /&gt;
  
              &lt;iisClientCertificateMappingAuthentication /&gt;
  
              &lt;windowsAuthentication enabled="false"&gt;
                  &lt;providers&gt;
                      &lt;add value="Negotiate" /&gt;
                      &lt;add value="NTLM" /&gt;
                  &lt;/providers&gt;
              &lt;/windowsAuthentication&gt;
  
          &lt;/authentication&gt;
  
          &lt;authorization /&gt;
  
          &lt;ipSecurity /&gt;
  
          &lt;isapiCgiRestriction&gt;
              &lt;add path="%windir%\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll" allowed="true" groupId="ASP.NET v2.0.50727" description="ASP.NET v2.0.50727" /&gt;
              &lt;add path="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" allowed="true" groupId="ASP.NET v2.0.50727" description="ASP.NET v2.0.50727" /&gt;
              &lt;add path="C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" allowed="true" groupId="ASP.NET v4.0.30319" description="ASP.NET v4.0.30319" /&gt;
              &lt;add path="C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" allowed="true" groupId="ASP.NET v4.0.30319" description="ASP.NET v4.0.30319" /&gt;
              &lt;add path="%windir%\system32\inetsrv\asp.dll" allowed="true" groupId="ASP" description="Active Server Pages" /&gt;
          &lt;/isapiCgiRestriction&gt;
  
          &lt;requestFiltering&gt;
              &lt;fileExtensions allowUnlisted="true" applyToWebDAV="true"&gt;
                  &lt;add fileExtension=".asax" allowed="false" /&gt;
                  &lt;add fileExtension=".ascx" allowed="false" /&gt;
                  &lt;add fileExtension=".master" allowed="false" /&gt;
                  &lt;add fileExtension=".skin" allowed="false" /&gt;
                  &lt;add fileExtension=".browser" allowed="false" /&gt;
                  &lt;add fileExtension=".sitemap" allowed="false" /&gt;
                  &lt;add fileExtension=".config" allowed="false" /&gt;
                  &lt;add fileExtension=".cs" allowed="false" /&gt;
                  &lt;add fileExtension=".csproj" allowed="false" /&gt;
                  &lt;add fileExtension=".vb" allowed="false" /&gt;
                  &lt;add fileExtension=".vbproj" allowed="false" /&gt;
                  &lt;add fileExtension=".webinfo" allowed="false" /&gt;
                  &lt;add fileExtension=".licx" allowed="false" /&gt;
                  &lt;add fileExtension=".resx" allowed="false" /&gt;
                  &lt;add fileExtension=".resources" allowed="false" /&gt;
                  &lt;add fileExtension=".mdb" allowed="false" /&gt;
                  &lt;add fileExtension=".vjsproj" allowed="false" /&gt;
                  &lt;add fileExtension=".java" allowed="false" /&gt;
                  &lt;add fileExtension=".jsl" allowed="false" /&gt;
                  &lt;add fileExtension=".ldb" allowed="false" /&gt;
                  &lt;add fileExtension=".dsdgm" allowed="false" /&gt;
                  &lt;add fileExtension=".ssdgm" allowed="false" /&gt;
                  &lt;add fileExtension=".lsad" allowed="false" /&gt;
                  &lt;add fileExtension=".ssmap" allowed="false" /&gt;
                  &lt;add fileExtension=".cd" allowed="false" /&gt;
                  &lt;add fileExtension=".dsprototype" allowed="false" /&gt;
                  &lt;add fileExtension=".lsaprototype" allowed="false" /&gt;
                  &lt;add fileExtension=".sdm" allowed="false" /&gt;
                  &lt;add fileExtension=".sdmDocument" allowed="false" /&gt;
                  &lt;add fileExtension=".mdf" allowed="false" /&gt;
                  &lt;add fileExtension=".ldf" allowed="false" /&gt;
                  &lt;add fileExtension=".ad" allowed="false" /&gt;
                  &lt;add fileExtension=".dd" allowed="false" /&gt;
                  &lt;add fileExtension=".ldd" allowed="false" /&gt;
                  &lt;add fileExtension=".sd" allowed="false" /&gt;
                  &lt;add fileExtension=".adprototype" allowed="false" /&gt;
                  &lt;add fileExtension=".lddprototype" allowed="false" /&gt;
                  &lt;add fileExtension=".exclude" allowed="false" /&gt;
                  &lt;add fileExtension=".refresh" allowed="false" /&gt;
                  &lt;add fileExtension=".compiled" allowed="false" /&gt;
                  &lt;add fileExtension=".msgx" allowed="false" /&gt;
                  &lt;add fileExtension=".vsdisco" allowed="false" /&gt;
                  &lt;add fileExtension=".rules" allowed="false" /&gt;
                  &lt;add fileExtension=".asa" allowed="false" /&gt;
              &lt;/fileExtensions&gt;
              &lt;verbs allowUnlisted="true" applyToWebDAV="true" /&gt;
              &lt;hiddenSegments applyToWebDAV="true"&gt;
                  &lt;add segment="web.config" /&gt;
                  &lt;add segment="bin" /&gt;
                  &lt;add segment="App_code" /&gt;
                  &lt;add segment="App_GlobalResources" /&gt;
                  &lt;add segment="App_LocalResources" /&gt;
                  &lt;add segment="App_WebReferences" /&gt;
                  &lt;add segment="App_Data" /&gt;
                  &lt;add segment="App_Browsers" /&gt;
              &lt;/hiddenSegments&gt;
          &lt;/requestFiltering&gt;
  
      &lt;/security&gt;
  
      &lt;serverRuntime /&gt;
  
      &lt;serverSideInclude /&gt;
  
  
      &lt;tracing&gt;
  
          &lt;traceFailedRequests /&gt;
  
          &lt;traceProviderDefinitions&gt;
              &lt;add name="ASPNET" guid="{AFF081FE-0247-4275-9C4E-021F3DC1DA35}"&gt;
                  &lt;areas&gt;
                      &lt;add name="Infrastructure" value="1" /&gt;
                      &lt;add name="Module" value="2" /&gt;
                      &lt;add name="Page" value="4" /&gt;
                      &lt;add name="AppServices" value="8" /&gt;
                  &lt;/areas&gt;
              &lt;/add&gt;
              &lt;add name="WWW Server" guid="{3a2a4e84-4c21-4981-ae10-3fda0d9b0f83}"&gt;
                  &lt;areas&gt;
                      &lt;clear /&gt;
                      &lt;add name="Authentication" value="2" /&gt;
                      &lt;add name="Security" value="4" /&gt;
                      &lt;add name="Filter" value="8" /&gt;
                      &lt;add name="StaticFile" value="16" /&gt;
                      &lt;add name="CGI" value="32" /&gt;
                      &lt;add name="Compression" value="64" /&gt;
                      &lt;add name="Cache" value="128" /&gt;
                      &lt;add name="RequestNotifications" value="256" /&gt;
                      &lt;add name="Module" value="512" /&gt;
                      &lt;add name="FastCGI" value="4096" /&gt;
                  &lt;/areas&gt;
              &lt;/add&gt;
              &lt;add name="ASP" guid="{06b94d9a-b15e-456e-a4ef-37c984a2cb4b}"&gt;
                  &lt;areas&gt;
                      &lt;clear /&gt;
                  &lt;/areas&gt;
              &lt;/add&gt;
              &lt;add name="ISAPI Extension" guid="{a1c2040e-8840-4c31-ba11-9871031a19ea}"&gt;
                  &lt;areas&gt;
                      &lt;clear /&gt;
                  &lt;/areas&gt;
              &lt;/add&gt;
          &lt;/traceProviderDefinitions&gt;
  
      &lt;/tracing&gt;
  
      &lt;urlCompression /&gt;
  
      &lt;validation /&gt;
  
  &lt;/system.webServer&gt;
  &lt;location path="" overrideMode="Allow"&gt;
      &lt;system.webServer&gt;
          &lt;modules&gt;
              &lt;add name="HttpCacheModule" lockItem="true" /&gt;
              &lt;add name="StaticCompressionModule" lockItem="true" /&gt;
              &lt;add name="DefaultDocumentModule" lockItem="true" /&gt;
              &lt;add name="DirectoryListingModule" lockItem="true" /&gt;
              &lt;add name="IsapiFilterModule" lockItem="true" /&gt;
              &lt;add name="ProtocolSupportModule" lockItem="true" /&gt;
              &lt;add name="StaticFileModule" lockItem="true" /&gt;
              &lt;add name="AnonymousAuthenticationModule" lockItem="true" /&gt;
              &lt;add name="RequestFilteringModule" lockItem="true" /&gt;
              &lt;add name="CustomErrorModule" lockItem="true" /&gt;
              &lt;add name="IsapiModule" lockItem="true" /&gt;
              &lt;add name="HttpLoggingModule" lockItem="true" /&gt;
              &lt;add name="ConfigurationValidationModule" lockItem="true" /&gt;
              &lt;add name="OutputCache" type="System.Web.Caching.OutputCacheModule" preCondition="managedHandler" /&gt;
              &lt;add name="Session" type="System.Web.SessionState.SessionStateModule" preCondition="managedHandler" /&gt;
              &lt;add name="WindowsAuthenticationModule" lockItem="true" /&gt;
              &lt;add name="WindowsAuthentication" type="System.Web.Security.WindowsAuthenticationModule" preCondition="managedHandler" /&gt;
              &lt;add name="FormsAuthentication" type="System.Web.Security.FormsAuthenticationModule" preCondition="managedHandler" /&gt;
              &lt;add name="DefaultAuthentication" type="System.Web.Security.DefaultAuthenticationModule" preCondition="managedHandler" /&gt;
              &lt;add name="RoleManager" type="System.Web.Security.RoleManagerModule" preCondition="managedHandler" /&gt;
              &lt;add name="UrlAuthorization" type="System.Web.Security.UrlAuthorizationModule" preCondition="managedHandler" /&gt;
              &lt;add name="FileAuthorization" type="System.Web.Security.FileAuthorizationModule" preCondition="managedHandler" /&gt;
              &lt;add name="AnonymousIdentification" type="System.Web.Security.AnonymousIdentificationModule" preCondition="managedHandler" /&gt;
              &lt;add name="Profile" type="System.Web.Profile.ProfileModule" preCondition="managedHandler" /&gt;
              &lt;add name="UrlMappingsModule" type="System.Web.UrlMappingsModule" preCondition="managedHandler" /&gt;
              &lt;add name="ServiceModel-4.0" type="System.ServiceModel.Activation.ServiceHttpModule, System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="managedHandler,runtimeVersionv4.0" /&gt;
              &lt;add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" preCondition="managedHandler,runtimeVersionv4.0" /&gt;
              &lt;add name="ScriptModule-4.0" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="managedHandler,runtimeVersionv4.0" /&gt;
              &lt;add name="ServiceModel" type="System.ServiceModel.Activation.HttpModule, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" preCondition="managedHandler,runtimeVersionv2.0" /&gt;
              &lt;add name="FailedRequestsTracingModule" lockItem="true" /&gt;
          &lt;/modules&gt;
          &lt;handlers accessPolicy="Read, Script"&gt;        
          &lt;/handlers&gt;
      &lt;/system.webServer&gt;
  &lt;/location&gt;
  &lt;location path="apps.mydomain.com/test"&gt;
      &lt;system.webServer&gt;
          &lt;security&gt;
              &lt;authentication&gt;
                  &lt;anonymousAuthentication enabled="false" userName="" /&gt;
                  &lt;windowsAuthentication enabled="true" useKernelMode="true"&gt;
                      &lt;extendedProtection tokenChecking="None" /&gt;
                  &lt;/windowsAuthentication&gt;
              &lt;/authentication&gt;
          &lt;/security&gt;
      &lt;/system.webServer&gt;
  &lt;/location&gt;
  </code></pre>
  
  <p></p>