Configura Kestrel e accesso browser per Docker/Unraid
- Kestrel ora ascolta su 0.0.0.0:8080 per compatibilità Docker - HTTPS redirect attivo solo in sviluppo, disabilitato in prod - Aggiunta sezione "Kestrel" in appsettings.json e nuovo appsettings.Production.json con limiti di sicurezza - Healthcheck Docker ora usa wget su /health (porta 8080) - Aggiunta documentazione dettagliata in BROWSER_ACCESS_CONFIG.md - Migliorata accessibilità browser, supporto reverse proxy e SignalR
This commit is contained in:
@@ -3,6 +3,13 @@ using TradingBot.Services;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
// Configure Kestrel per Docker - Listen su tutte le interfacce
|
||||
builder.WebHost.ConfigureKestrel(serverOptions =>
|
||||
{
|
||||
// Listen su porta 8080 per Docker
|
||||
serverOptions.ListenAnyIP(8080);
|
||||
});
|
||||
|
||||
// Add services to the container.
|
||||
builder.Services.AddRazorComponents()
|
||||
.AddInteractiveServerComponents();
|
||||
@@ -26,7 +33,12 @@ if (!app.Environment.IsDevelopment())
|
||||
app.UseHsts();
|
||||
}
|
||||
|
||||
app.UseHttpsRedirection();
|
||||
// Disabilita HTTPS redirect in Docker/Production
|
||||
// Docker gestisce HTTPS tramite reverse proxy se necessario
|
||||
if (app.Environment.IsDevelopment())
|
||||
{
|
||||
app.UseHttpsRedirection();
|
||||
}
|
||||
|
||||
app.UseStaticFiles();
|
||||
app.UseAntiforgery();
|
||||
|
||||
Reference in New Issue
Block a user