mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-12-06 09:13:03 +03:00
Some image links are broken when using a base directory other than the server root #1130
Reference in New Issue
Block a user
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 @rohanshekhar on GitHub.
Subject of the issue
Image reference "totp-countdown.png" is broken when DOMAIN base directory is set to something other than the root directory.
Deployment environment
Install method: Docker Image
Clients used: Desktop
Reverse proxy and version: Nginx
Other relevant details:
Steps to reproduce
Log into the web interface and open any saved password.
Expected behaviour
The image totp-countdown.png to the right of the Authenticator Key field should be displayed.

Actual behaviour
The image reference is broken. When inspecting the element, it shows a relative path "../../images/totp-countdown.png" which moves it to a top-level directory above the bitwarden base directory (which in my case has the structure https://example.com/bitwarden/).
Troubleshooting data
The image seems to be referenced somewhere inside the angular app. Tried to rewrite "../../images/" to "./images" using the http sub module in Nginx but it seems not to modify the resulting HTML. As a workaround, I've used an ugly hack to rewrite /images/ to /bitwarden/images but this makes the subfolder unavailable to other docker containers.
@BlackDex commented on GitHub:
I'm afraid that isn't something we can fix on our side that easily.
We probably need to check the upstream code from Bitwarden and fix it there.
@rohanshekhar commented on GitHub:
Thanks @BlackDex , I checked nginx subdirectory examples and my configuration is identical. It seems everything else works fine except for the image source for "totp-countdown.png". I know it's just cosmetic, but I'm fairly sure that the image url should not have two directory level-ups in it. I've inspected the element as shown below. Of course, "../../images/totp-countdown.png" will have no impact when vaultwarden runs on the server root, since you can only change directory a single level up before hitting root. However, when running vaultwarden in a subdirectory, it points to one level above that subdirectory, so the image cannot be found.
@rohanshekhar commented on GitHub:
@BlackDex please see support string below:
Your environment (Generated via diagnostics page)
Config (Generated via diagnostics page)
Show Running Config
Environment settings which are overridden:
@BlackDex commented on GitHub:
Please provide the support string you can generate via the admin interface.
@BlackDex commented on GitHub:
That all looks ok. I would double check the reverse proxy config. Maybe there is a small miss configuration there.
https://github.com/dani-garcia/vaultwarden/wiki/Proxy-examples
Since, the base containers are just working fine and provide the images and stylesheets etc..