I'm managing a web app on windows server 2012R2 (iis 8.5).
I have default.aspx page that redirects to a different app, and also redirects http to https.
inetpub\wwwroot\default.aspx
<%@ Page Language="VB" %>
<%
host = Request.ServerVariables("SERVER_NAME")
entryUrl = "https://" & host & "/foo/bar.aspx"
Response.Redirect( entryUrl )
%>
I find that when I first create the VM (with Chef and the iis cookbook), and navigate to localhost, I am not automatically redirected to https://localhost/foo/bar.aspx
like I expect. Restarting IIS, and the application pools fails to fix the issue.
Doing a full reboot of the windows server is the only way I've worked around the issue.
What could cause the redirect to not work until a reboot?
The following modules are installed:
PS C:\Users\sowen> C:\Windows\System32\inetsrv\appcmd.exe list modules
MODULE "HttpCacheModule" ( native, preCondition: )
MODULE "StaticCompressionModule" ( native, preCondition: )
MODULE "DefaultDocumentModule" ( native, preCondition: )
MODULE "DirectoryListingModule" ( native, preCondition: )
MODULE "IsapiFilterModule" ( native, preCondition: )
MODULE "ProtocolSupportModule" ( native, preCondition: )
MODULE "StaticFileModule" ( native, preCondition: )
MODULE "AnonymousAuthenticationModule" ( native, preCondition: )
MODULE "RequestFilteringModule" ( native, preCondition: )
MODULE "CustomErrorModule" ( native, preCondition: )
MODULE "IsapiModule" ( native, preCondition: )
MODULE "HttpLoggingModule" ( native, preCondition: )
MODULE "UrlRoutingModule-4.0" ( type:System.Web.Routing.UrlRoutingModule, preCondition:managedHandler,runtimeVersionv4.0 )
MODULE "ScriptModule-4.0" ( type:System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, preCondition:managedHandler,runtimeVersionv4.0 )
MODULE "OutputCache" ( type:System.Web.Caching.OutputCacheModule, preCondition:managedHandler )
MODULE "Session" ( type:System.Web.SessionState.SessionStateModule, preCondition:managedHandler )
MODULE "WindowsAuthentication" ( type:System.Web.Security.WindowsAuthenticationModule, preCondition:managedHandler )
MODULE "FormsAuthentication" ( type:System.Web.Security.FormsAuthenticationModule, preCondition:managedHandler )
MODULE "DefaultAuthentication" ( type:System.Web.Security.DefaultAuthenticationModule, preCondition:managedHandler )
MODULE "RoleManager" ( type:System.Web.Security.RoleManagerModule, preCondition:managedHandler )
MODULE "UrlAuthorization" ( type:System.Web.Security.UrlAuthorizationModule, preCondition:managedHandler )
MODULE "FileAuthorization" ( type:System.Web.Security.FileAuthorizationModule, preCondition:managedHandler )
MODULE "AnonymousIdentification" ( type:System.Web.Security.AnonymousIdentificationModule, preCondition:managedHandler ) MODULE "Profile" ( type:System.Web.Profile.ProfileModule, preCondition:managedHandler )
MODULE "UrlMappingsModule" ( type:System.Web.UrlMappingsModule, preCondition:managedHandler )
MODULE "ConfigurationValidationModule" ( native, preCondition: )
MODULE "HttpRedirectionModule" ( native, preCondition: )
MODULE "CustomLoggingModule" ( native, preCondition: )
MODULE "ServiceModel-4.0" ( type:System.ServiceModel.Activation.ServiceHttpModule, System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, preCondition:managedHandler,runtimeVersionv4.0 )
MODULE "ApplicationInitializationModule" ( native, preCondition: )
MODULE "WebSocketModule" ( native, preCondition: )
MODULE "ServerSideIncludeModule" ( native, preCondition: )
default.aspx is part of the default documents.
I'm very new to IIS, so any ideas are appreciated.