|
|
@ -24,6 +24,11 @@ namespace NikolaNet |
|
|
|
public void ConfigureServices(IServiceCollection services) |
|
|
|
public void ConfigureServices(IServiceCollection services) |
|
|
|
{ |
|
|
|
{ |
|
|
|
services.AddRazorPages(); |
|
|
|
services.AddRazorPages(); |
|
|
|
|
|
|
|
services.Configure<ForwardedHeadersOptions>(options => |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
options.ForwardedHeaders = |
|
|
|
|
|
|
|
ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto; |
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
|
|
|
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
|
|
@ -32,12 +37,14 @@ namespace NikolaNet |
|
|
|
if (env.IsDevelopment()) |
|
|
|
if (env.IsDevelopment()) |
|
|
|
{ |
|
|
|
{ |
|
|
|
app.UseDeveloperExceptionPage(); |
|
|
|
app.UseDeveloperExceptionPage(); |
|
|
|
|
|
|
|
app.UseForwardedHeaders(); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
|
app.UseExceptionHandler("/Error"); |
|
|
|
app.UseExceptionHandler("/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.UseForwardedHeaders(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
app.UseHttpsRedirection(); |
|
|
|
app.UseHttpsRedirection(); |
|
|
|