2017-12-18 24 views
0

SSL을 asp.net 핵심 프로젝트에 통합하려고합니다. manuel 확인을 위해 sslforfree 파일을 다운로드합니다. 내 서버에.Net Core SSL 파일이 페이지를 찾을 수 없습니다. 웹 주소에 대한 웹 페이지가 없습니다.

어떤 웹 페이지를 찾을 수 없습니다이 페이지는 다음 웹 주소()에 대해 발견 된

브라우저에서 내 웹 사이트를 탐색 할 때 그 오류를주는 경로에 서버에 파일이 있지만 :

여기가 링크입니다.

이 파일

여기

을 확인 표시하지 않습니다 work.Just 내 서버 경로 파일

내가 마임 유형 을 제공 IIS 서버에서 enter image description here

입니다. (쉼표) 내 그물 코어 웹 사이트

로 text/plain 하지만 여전히 오류가 발생합니다. 어떻게해야합니까? 4.0 응용 프로그램 풀이있는 .net mvc 프로젝트에서 작동하지만 asp.net 핵심 응용 프로그램 풀에서 페이지를 찾을 수 없음 오류가 발생했습니다.

여기에 기본 StaticFilesMiddleware으로

public class Startup 
    { 
     public Startup(IConfiguration configuration) 
     { 
      Configuration = configuration; 
     } 

     public IConfiguration Configuration { get; } 

     // This method gets called by the runtime. Use this method to add services to the container. 
     public void ConfigureServices(IServiceCollection services) 
     { 
      services.AddMvc(); 
      services.AddSession(); 


     } 

     // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 
     public void Configure(IApplicationBuilder app, IHostingEnvironment env) 
     { 
      if (env.IsDevelopment()) 
      { 
       app.UseDeveloperExceptionPage(); 
       app.UseBrowserLink(); 
      } 
      else 
      { 
       app.UseExceptionHandler("/Home/Error"); 
      } 

      app.UseStaticFiles(); 
      app.UseSession(); 

      app.UseMvc(routes => 
      { 
       routes.MapRoute(
        name: "default", 
        template: "{controller=Home}/{action=Index}/{id?}"); 
      }); 

      app.UseMvc(routes => 
      { 
       routes.MapRoute(
        name: "default2", 
        template: "{controller=Admin}/{action=BookFastSearch}/{id?}"); 
      }); 
     } 
    } 
+0

Startup.Configure에서 파이프 라인은 어떻게 생겼을까요? –

+0

@IvanZaruba answear.I 주셔서 감사합니다. 내가 액세스 할 수있는 명령을 추가해야합니까? 질문이 끝나면 startup.cs를 추가 했습니까? – user1688401

답변

2

이 연장됩니다 및 알려진 유형이 될 것입니다 요청 된 파일을 기대하고 내 startup.cs입니다. 확장자가 없으므로 해당 파일을 제공 할 사용자 정의 미들웨어를 추가하거나 기본 미들웨어를 구성 할 수 있습니다.

app.UseStaticFiles(new StaticFileOptions 
{ 
    ServeUnknownFileTypes = true 
});