From 1131617fde9acfece1838a27a15a35b0d4cdd255 Mon Sep 17 00:00:00 2001 From: Mykola Date: Tue, 16 Feb 2021 09:42:37 -0700 Subject: [PATCH] #510 fixed static images behind path-based proxy (#511) --- src/Web/Startup.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Web/Startup.cs b/src/Web/Startup.cs index 859e24d..04176d9 100644 --- a/src/Web/Startup.cs +++ b/src/Web/Startup.cs @@ -170,6 +170,16 @@ namespace Microsoft.eShopWeb.Web // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { + var catalogBaseUrl = Configuration.GetValue(typeof(string), "CatalogBaseUrl") as string; + if (!string.IsNullOrEmpty(catalogBaseUrl)) + { + app.Use((context, next) => + { + context.Request.PathBase = new PathString(catalogBaseUrl); + return next(); + }); + } + app.UseHealthChecks("/health", new HealthCheckOptions {