fix: resolve two build errors — siteBaseUrl self-reference + ForwardedHeaders
- Index.cshtml: siteBaseUrl was referencing itself as fallback; replaced with literal default "https://draletaha.ir" - Program.cs: removed UseForwardedHeaders call — ForwardedHeadersOptions unavailable in this SDK config; SITE_BASE_URL env var handles base URL Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user