diff --git a/backend/i18n/source/backend_en.json b/backend/i18n/source/backend_en.json index 668425f10..158e0c5e6 100644 --- a/backend/i18n/source/backend_en.json +++ b/backend/i18n/source/backend_en.json @@ -291,8 +291,8 @@ "setup.ruleHttps.failure": " You are not accessing the site over https. If this warning is not correct then Squidex cannot detect https mode, because your instance is behind a reverse proxy such as nginx. Ensure that http headers are forwarded properly, via the X-Forwarded-* headers.", "setup.ruleHttps.success": "Congratulations, you are accessing your Squidex installation over a secure connection (https).", "setup.rules.headline": "System Checklist", - "setup.ruleUrl.failure": "You should access Squidex only over one one canonical URL and configure this URL over the URLS__BASEURL environment variable. The current base URL {actual} does not match to the base url {configured}.", - "setup.ruleUrl.success": "Congratulations the URLS__BASEURL environment variable is configured properly.", + "setup.ruleUrl.failure": "You should access Squidex only over one canonical URL and configure this URL with the URLS__BASEURL environment variable. The current base URL {actual} does not match to the base url {configured}.", + "setup.ruleUrl.success": "Congratulations, the URLS__BASEURL environment variable is configured properly.", "setup.title": "Installation", "users.accessDenied.text": "This operation is not allowed, your account might be locked.", "users.accessDenied.title": "Access denied", diff --git a/backend/src/Squidex.Shared/Texts.nl.resx b/backend/src/Squidex.Shared/Texts.nl.resx index b19c1df3a..4835fbde0 100644 --- a/backend/src/Squidex.Shared/Texts.nl.resx +++ b/backend/src/Squidex.Shared/Texts.nl.resx @@ -959,10 +959,10 @@ System Checklist - You should access Squidex only over one one canonical URL and configure this URL over the <code>URLS__BASEURL</code> environment variable. The current base URL <code>{actual}</code> does not match to the base url <code>{configured}</code>. + You should access Squidex only over one canonical URL and configure this URL with the <code>URLS__BASEURL</code> environment variable. The current base URL <code>{actual}</code> does not match to the base url <code>{configured}</code>. - Congratulations the <code>URLS__BASEURL</code> environment variable is configured properly. + Congratulations, the <code>URLS__BASEURL</code> environment variable is configured properly. Installation diff --git a/backend/src/Squidex.Shared/Texts.resx b/backend/src/Squidex.Shared/Texts.resx index 21bcf49b5..eb7a5327d 100644 --- a/backend/src/Squidex.Shared/Texts.resx +++ b/backend/src/Squidex.Shared/Texts.resx @@ -959,10 +959,10 @@ System Checklist - You should access Squidex only over one one canonical URL and configure this URL over the <code>URLS__BASEURL</code> environment variable. The current base URL <code>{actual}</code> does not match to the base url <code>{configured}</code>. + You should access Squidex only over one canonical URL and configure this URL with the <code>URLS__BASEURL</code> environment variable. The current base URL <code>{actual}</code> does not match to the base url <code>{configured}</code>. - Congratulations the <code>URLS__BASEURL</code> environment variable is configured properly. + Congratulations, the <code>URLS__BASEURL</code> environment variable is configured properly. Installation diff --git a/backend/src/Squidex.Web/Pipeline/SetupMiddleware.cs b/backend/src/Squidex.Web/Pipeline/SetupMiddleware.cs index d6a63cd79..305c42811 100644 --- a/backend/src/Squidex.Web/Pipeline/SetupMiddleware.cs +++ b/backend/src/Squidex.Web/Pipeline/SetupMiddleware.cs @@ -25,7 +25,9 @@ namespace Squidex.Web.Pipeline { if (!isUserFound && await userService.IsEmptyAsync()) { - context.Response.Redirect("/identity-server/setup"); + var url = context.Request.PathBase.Add("/identity-server/setup"); + + context.Response.Redirect(url); } else { diff --git a/backend/src/Squidex/Areas/IdentityServer/Controllers/Setup/SetupController.cs b/backend/src/Squidex/Areas/IdentityServer/Controllers/Setup/SetupController.cs index a92a5b0c4..f9b5893d1 100644 --- a/backend/src/Squidex/Areas/IdentityServer/Controllers/Setup/SetupController.cs +++ b/backend/src/Squidex/Areas/IdentityServer/Controllers/Setup/SetupController.cs @@ -20,6 +20,7 @@ using Squidex.Infrastructure; using Squidex.Infrastructure.Reflection; using Squidex.Infrastructure.Translations; using Squidex.Infrastructure.Validation; +using Squidex.Web; namespace Squidex.Areas.IdentityServer.Controllers.Setup { @@ -99,12 +100,10 @@ namespace Squidex.Areas.IdentityServer.Controllers.Setup { var externalProviders = await SignInManager.GetExternalProvidersAsync(); - var request = HttpContext.Request; - var result = new SetupVM { BaseUrlConfigured = urlGenerator.BuildUrl(string.Empty, false), - BaseUrlCurrent = $"{request.Scheme}://{request.Host}", + BaseUrlCurrent = GetCurrentUrl(), ErrorMessage = errorMessage, EverybodyCanCreateApps = !uiOptions.OnlyAdminsCanCreateApps, IsValidHttps = HttpContext.Request.IsHttps, @@ -121,5 +120,19 @@ namespace Squidex.Areas.IdentityServer.Controllers.Setup return result; } + + private string GetCurrentUrl() + { + var request = HttpContext.Request; + + var url = $"{request.Scheme}://{request.Host}{request.PathBase}"; + + if (url.EndsWith(Constants.PrefixIdentityServer, StringComparison.Ordinal)) + { + url = url[0..^Constants.PrefixIdentityServer.Length]; + } + + return url.TrimEnd('/'); + } } }