Can't download attachements from self hosted bitwarden

we have a new self hosted instalation of bitwarden. Everything is working exept for downloading of attachments. Uploading and deleting attachments work.

When we click on attachement to download it just spins, when looking at dev console in browser i can see that its actually trying to access http://localhost:4000/attachments//xxxxxxxxxxxxxxxx to download it. Looks like url rewrite is failing on nginx that comes with the bitwarden install. We do not have other proxies.
./bwdata/env/global.override.env
./bwdata/config.yml

both have correct url configured.

where else can this be configured?

I’m having the same issue with a new self-hosted instance through a custom domain (not localhost). I don’t see any instances of localhost in global.override.env or config.yaml

Bitwarden version:
Status: Image is up to date for bitwarden/setup:1.41.3
docker.io/bitwarden/setup:1.41.3

When I try to download the attachment, the request is to:

domain/api/ciphers/…/attachment/…

and the response json is:
{“Object”:“attachment”,“Id”:“long id here”,“Url”:“http://localhost:4000/attachments//long key here”,“FileName”:“2.”,“Size”:“8327857”,“SizeName”:“7.94 MB”}

my case is solved. In my case i had to add the following to the global.override.env file:

globalSettings__attachment__baseDirectory=/etc/bitwarden/core/attachments
globalSettings__attachment__baseUrl=https://YOURDOMAINHERE/attachments
globalSettings__send__baseDirectory=/etc/bitwarden/core/attachments/send
globalSettings__send__baseUrl=https://YOURDOMAINHERE/attachments/send

1 Like

I’m getting the same issues with attachments & send self hosted.
Tried what @donatas recommended, but i don’t have a /etc/bitwarden/core/attachments directory
However updating baseURL got me a little closer

I can see attachments and send files being uploaded to:
Attachments with out the a
/opt/bitwarden/bwdata/core/attchments$ ls
5091fd3f-e951-4031-bb03-ad410061afa6

Ant this is the link the web page is trying to get to:
https://mydomain/attachments/5091fd3f-e951-4031-bb03-ad410061afa6/6n7uzhzmgeswm25fgtcheazu33ni7h92

Tried setting globalSettings__attachment__baseDirectory to the location above, but no luck.
Any thoughts?