You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have an existing DotVVM app, let's say its base address is https://app.org.tld/. Now we want to also access it via a proxy server, with the resulting base address being https://new.org.tld/app/. The proxy server correctly sends the header X-Forwarded-Prefix: /app. We need the app to be accessed from both base URLs.
The correct way to solve this problem in ASP.NET Core 8.0 is to use app.UseForwardedHeaders() as described in the documentation (writing custom middleware is required for previous versions). This works perfectly for routing and redirects, however resource paths rendered into the HTML do not behave as expected since the paths are only computed once.
Example 1:
Restart the app
The first request comes in from https://app.org.tld/, PathBase is set to /
The response HTML contains correct script and style resource URLs in the format <script src="/dotvvmResource/...
The next request comes in from https://new.org.tld/app/, PathBase is set to /app
The response HTML still contains URLs in the format <script src="/dotvvmResource/... when they should be <script src="/app/dotvvmResource/...
Example 2:
Restart the app
The first request comes in from https://new.org.tld/app/, PathBase is set to /app
The response HTML contains correct script and style resource URLs in the format <script src="/app/dotvvmResource/...
The next request comes in from https://app.org.tld/, PathBase is set to /
The response HTML still contains URLs in the format <script src="/app/dotvvmResource/... when they should be <script src="/dotvvmResource/...
When the PathBase changes, DotVVM should render updated resource URLs and not reuse the URLs from a request that had a different PathBase.
The text was updated successfully, but these errors were encountered:
We have an existing DotVVM app, let's say its base address is
https://app.org.tld/
. Now we want to also access it via a proxy server, with the resulting base address beinghttps://new.org.tld/app/
. The proxy server correctly sends the headerX-Forwarded-Prefix: /app
. We need the app to be accessed from both base URLs.The correct way to solve this problem in ASP.NET Core 8.0 is to use
app.UseForwardedHeaders()
as described in the documentation (writing custom middleware is required for previous versions). This works perfectly for routing and redirects, however resource paths rendered into the HTML do not behave as expected since the paths are only computed once.Example 1:
https://app.org.tld/
,PathBase
is set to/
<script src="/dotvvmResource/...
https://new.org.tld/app/
,PathBase
is set to/app
<script src="/dotvvmResource/...
when they should be<script src="/app/dotvvmResource/...
Example 2:
https://new.org.tld/app/
,PathBase
is set to/app
<script src="/app/dotvvmResource/...
https://app.org.tld/
,PathBase
is set to/
<script src="/app/dotvvmResource/...
when they should be<script src="/dotvvmResource/...
When the
PathBase
changes, DotVVM should render updated resource URLs and not reuse the URLs from a request that had a differentPathBase
.The text was updated successfully, but these errors were encountered: