fix(xo-server): proxy issue if hostname defined (#9572)

fix #9500
This commit is contained in:
Mathieu
2026-03-09 09:49:24 +01:00
committed by GitHub
parent 57aec1ab2d
commit 82f047ef9d
2 changed files with 6 additions and 1 deletions

View File

@@ -17,9 +17,9 @@
- [Backup] snapshots of VM with a CDROM mounted are not removed (PR [#9570](https://github.com/vatesfr/xen-orchestra/pull/9570))
- [OpenMetrics] Fix plugin failing to auto-start after xo-server restart due to XOA WebSocket connection race condition (PR [#9402](https://github.com/vatesfr/xen-orchestra/pull/9402))
- **XO 5**:
- [Self Service] Fix RAM usage not being properly updated in some cases. Please use "Recompute all limits" in the Self Service dashboard to fix any incorrect quota values introduced by this bug. (PR [#9566](https://github.com/vatesfr/xen-orchestra/pull/9566))
- If a hostname was defined in a configuration file, `/v5` were not accessible [#9500](https://github.com/vatesfr/xen-orchestra/issues/9500) (PR [#9572](https://github.com/vatesfr/xen-orchestra/pull/9572))
### Packages to release
@@ -39,5 +39,6 @@
- @xen-orchestra/backups patch
- xo-server patch
- xo-server-openmetrics patch
<!--packages-end-->

View File

@@ -628,6 +628,10 @@ const setUpProxies = (express, opts, xo) => {
targetUrl.protocol = targetUrl.protocol === 'ws:' ? 'wss:' : 'https:'
}
if (userHttpConfig.hostname !== undefined && targetUrl.hostname === 'localhost') {
targetUrl.hostname = userHttpConfig.hostname
}
return targetUrl
}