I’ve got a fresh install of Vaultwarden in a docker container. Install script below:
docker pull vaultwarden/server:latest
docker run -d --name vaultwarden -v /vw-data/:/data/ --restart unless-stopped -p 8080:80 vaultwarden/server:latest
I’m using npm on a different machine for reverse proxy and lets encrypt cert. npm config below:
I can login and everything seems to be working fine, however when I attempt to import my vault I get a 504 Gateway Time-out error.
If I only place a couple lines in the “or copy/paste the import file contents” box, they data will import, but anything over a few lines just gives the same 504 error.
This is what I see in my npm error log:
2024/03/07 23:13:57 [warn] 1357#1357: *15349 a client request body is buffered to a temporary file /tmp/nginx/body/6/16/0000000166, client: [CLIENTIPADDR], server: [SVRDNSNAME], request: "POST /api/ciphers/import HTTP/1.1", host: "[SVRDNSNAME]", referrer: "https://[SVRDNSNAME]/"
2024/03/07 23:15:27 [error] 1357#1357: *15349 upstream timed out (110: Connection timed out) while reading response header from upstream, client: [CLIENTIPADDR], server: [SVRDNSNAME], request: "POST /api/ciphers/import HTTP/1.1", upstream: "http://[SVRIPADDR]:8080/api/ciphers/import", host: "[SVRDNSNAME]", referrer: "https://[SVRDNSNAME]/"
I’ve attempted to change the network on the docker container to the host instead of the bridge just to make sure there wasn’t something with it not being able to communicate which didn’t help.
I added the following to npm to see if it helped and it didn’t:
location /admin {
return 404;
}
location / {
proxy_pass http://[SVRIPADDR]:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
location /notifications/hub {
proxy_pass http://[SVRIPADDR]:3012;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location /notifications/hub/negotiate {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://[SVRIPADDR]:8080;
}
I even attempted to add some crazy timeouts to see if that made a difference and while I no longer got the error (because I didn’t wait that long) it also never imported.
proxy_connect_timeout 3000;
proxy_send_timeout 3000;
proxy_read_timeout 3000;
send_timeout 3000;