사이트가 https 모드 (로컬 개발 제외)로 항상 열어야하는 요구 사항이 있습니다. 내부 앱입니다.HTTPS - Mvc3 - Visual Studio 2010
web.config 항목을 https에 대해 true로 실행하면 사이트가 원을 그리며 요청을 계속 반복하는 것처럼 보입니다.
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
filters.Add(new HandleErrorAttribute());
//make sure that the remote site opens in https mode.
bool isSSL = false;
bool.TryParse(ConfigurationManager.AppSettings[ApplicationKeys.IsSSLRequired], out isSSL);
if (isSSL && !HttpContext.Current.Request.IsLocal && !HttpContext.Current.Request.IsSecureConnection)
filters.Add(new RequireHttpsAttribute());
}
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
RegisterGlobalFilters(GlobalFilters.Filters);
RegisterRoutes(RouteTable.Routes);
//RouteDebug.RouteDebugger.RewriteRoutesForTesting(RouteTable.Routes);
//wire up Unity IoC
container = new UnityContainer();
UnityBootstrapper.ConfigureContainer(container);
EntityMapper.MapEntities();
DependencyResolver.SetResolver(new UnityDependencyResolver(container));
//wire up Unity Controller Factory
ControllerBuilder.Current.SetControllerFactory(new UnityControllerFactory());
}
무엇이 여기에 있습니까?
전역 파일에서 코드를 제거하고 web.config에서 규칙을 만들었습니다. http를 사용할 때 "페이지가 제대로 리디렉션되지 않습니다"라는 오류 메시지가 나타납니다. 여기에 규칙입니다 : < "(. *)"일치 URL = /> <규칙 이름 = "HTTPS로 리디렉션"> <= 입력을 추가 "{SERVER_PORT}"패턴 = "443 "부정 ="진정한 "/> <작업 유형은 =" "URL ="http://dev.domain.com/Study/{R:1} "/> –
나 '리디렉션 HTTPS로 리디렉션하도록 지정하지 않았기 때문에 무한 리디렉션 루프에 있다고 생각합니다. url 속성은 귀하가 귀하의 의견에 입력 한 내용을 통해 "https://dev.domain.com/Study{R:1}"과 유사해야합니다. –
그래서 https://dev.domain.com/Study/ {R : 1}이되어야합니다 ??? –