diff --git a/DrSousan.Api/Pages/Index.cshtml b/DrSousan.Api/Pages/Index.cshtml index 4b8084f..c62131a 100644 --- a/DrSousan.Api/Pages/Index.cshtml +++ b/DrSousan.Api/Pages/Index.cshtml @@ -1,7 +1,7 @@ @page @model IndexModel @{ - var siteBaseUrl = Environment.GetEnvironmentVariable("SITE_BASE_URL")?.TrimEnd('/') ?? (siteBaseUrl); + var siteBaseUrl = Environment.GetEnvironmentVariable("SITE_BASE_URL")?.TrimEnd('/') ?? "https://draletaha.ir"; var h = Model.Hero; var a = Model.About; var c = Model.Contact; diff --git a/DrSousan.Api/Program.cs b/DrSousan.Api/Program.cs index 2482c39..5103b69 100644 --- a/DrSousan.Api/Program.cs +++ b/DrSousan.Api/Program.cs @@ -57,13 +57,6 @@ builder.Services.ConfigureHttpJsonOptions(opts => // ── Build ───────────────────────────────────────────────────────────────────── var app = builder.Build(); -// Trust the X-Forwarded-Proto header from nginx so ctx.Request.Scheme = "https" -// This fixes canonical URLs, sitemap, robots.txt, og:image all using http:// on production -app.UseForwardedHeaders(new Microsoft.AspNetCore.HttpOverrides.ForwardedHeadersOptions -{ - ForwardedHeaders = Microsoft.AspNetCore.HttpOverrides.ForwardedHeaders.XForwardedFor - | Microsoft.AspNetCore.HttpOverrides.ForwardedHeaders.XForwardedProto -}); app.UseCors(); app.UseDefaultFiles(); // serves /admin/index.html for /admin/ (wwwroot/index.html deleted → no conflict with Razor Pages)