mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-03-02 22:57:18 -05:00
Broken relative URLs in Web-vault main page due to incorrect base URL path (DOMAIN=https://domain.tld/vw) #2393
Labels
No labels
SSO
Third party
better for forum
bug
bug
documentation
duplicate
enhancement
future Vault
future Vault
future Vault
good first issue
help wanted
low priority
notes
question
troubleshooting
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vaultwarden#2393
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Delicates on GitHub (Sep 10, 2025).
Prerequisites
Vaultwarden Support String
Your environment (Generated via diagnostics page)
Non-docker Gentoo ebuild with Haproxy.
Using
DOMAIN=https://domain.tld/vw(URL with path) in the ENV config file as per template.Issue
https://domain.tld/vw web page is broken - once HTML loads, all relative URLs (stylesheets, scripts, images, etc.) are being loaded from the
/root URL as the<base>path instead of the correct/vw/URL path.https://domain.tld/vw/ web page works fine, all relative URLs load from the correct
/vw/base URL path .This is aggravated by VW SMTP Test emails being sent with the https://domain.tld/vw broken web page URL.
I tried setting
DOMAIN=https://domain.tld/vw/, but this has no effect neither on the web page, nor on the URLs in the VW SMTP Test emails.Root cause
Obviously with the https://domain.tld/vw URL web browsers consider
/as the site<base>directory and fail to load all relative URLs.With https://domain.tld/vw/ URL they consider
/vw/as the site<base>directory and all relative URLs load fine.Proxy Workaround
I had to work around this by baking a URL redirect from
/vwto/vw/into the Proxy config:Vaultwarden Build Version
1.34.3
Deployment method
OS Package (apt, yum/dnf, pacman, apk, nix, ...)
Custom deployment method
No response
Reverse Proxy
Haproxy 3.2.3
Host/Server Operating System
Linux
Operating System Version
Gentoo
Clients
Web Vault
Client Version
Firefox 142.0.1 - v2025.7.1
Steps To Reproduce
Expected Result
Web page should load regardless of whether you use https://domain.tld/vw or https://domain.tld/vw/ URL.
Expectation 1
Web-vault should either (in order of decreasing preference):
<base href="https://domain.tld/path/" />in the main https://domain.tld/path web page, or/path/fileURLs instead of relativefileURLs.Expectation 2
All VW emails should also use the correct https://domain.tld/vw/ base URL path instead of the incorrect https://domain.tld/vw. The VW SMTP Test email should be fixed, and others checked.
Expectation 3
For accuracy the ENV template example should be changed from using incorrect base URL path:
to correct base URL path:
Actual Result
Logs
Screenshots or Videos
Additional Context
No response
@BlackDex commented on GitHub (Oct 14, 2025):
I'm afraid we can't fix this on the server side.
The same issue applies to both sub-path or no sub-path, but we can not determine if someone used a
/at the end or not when there is no sub-path defined.Having two different ways of working for reverse proxies will make it only difficult and inconsistent.
I have checked again, but we are just not able to get the specific details at the lowest level possible for us to see if non-sub-path's were requested with or without a
/.So, the only way to fix this is by using the reverse proxy to either redirect it self or some other way to fix that.
For haproxy you can also do this in the frontend.