Fix error pages
This commit is contained in:
parent
0674d906ee
commit
65431da22c
|
@ -7,6 +7,7 @@ using KamihamaWeb.Services;
|
||||||
using KamihamaWeb.Util;
|
using KamihamaWeb.Util;
|
||||||
using Microsoft.AspNetCore.Builder;
|
using Microsoft.AspNetCore.Builder;
|
||||||
using Microsoft.AspNetCore.Hosting;
|
using Microsoft.AspNetCore.Hosting;
|
||||||
|
using Microsoft.AspNetCore.HttpOverrides;
|
||||||
using Microsoft.AspNetCore.HttpsPolicy;
|
using Microsoft.AspNetCore.HttpsPolicy;
|
||||||
using Microsoft.AspNetCore.ResponseCompression;
|
using Microsoft.AspNetCore.ResponseCompression;
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
|
@ -96,14 +97,19 @@ namespace KamihamaWeb
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
app.UseForwardedHeaders(new ForwardedHeadersOptions
|
||||||
|
{
|
||||||
|
ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto
|
||||||
|
});
|
||||||
app.UseExceptionHandler("/Home/Error");
|
app.UseExceptionHandler("/Home/Error");
|
||||||
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
|
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
|
||||||
app.UseHsts();
|
//app.UseHsts();
|
||||||
}
|
}
|
||||||
|
|
||||||
app.UseHttpCacheHeaders();
|
app.UseHttpCacheHeaders();
|
||||||
app.UseHttpsRedirection();
|
app.UseHttpsRedirection();
|
||||||
app.UseStaticFiles();
|
app.UseStaticFiles();
|
||||||
|
app.UseStatusCodePagesWithReExecute("/Error/{0}");
|
||||||
app.UseRouting();
|
app.UseRouting();
|
||||||
app.UseResponseCompression();
|
app.UseResponseCompression();
|
||||||
app.UseAuthorization();
|
app.UseAuthorization();
|
||||||
|
|
Loading…
Reference in New Issue