How to setup vaultwarden

hmm I don’t see Nginx running on your output. There is no LISTEN port 80/443. Are you able to access PiHole web interface from inside your local network?

No not anymore, it was till i done this step:

 #       location / {
#               try_files $uri $uri/ =404;
#       }

and this step:

IP_HEADER=X-Forwarded-For
WEBSOCKET_ENABLED=true
WEBSOCKET_ADDRESS=0.0.0.0
WEBSOCKET_PORT=3012
DOMAIN=https://mydomain.ddnsprovider.com
#ROCKET_TLS={certs="./cert.pem",key="./privkey.pem"}

From this thread above, then i decided to write here in this forum

let’s do it step by step. Can you revert your change first to get Nginx back online.

Yes i hope so. :blush: So i have do delete the domain name and the websocket port to? ohh i just uncommand it.

remove your changes done completely and go back to default settings

so i tried it, but it seems not working. Maybe it´s better to deinstall the software packages completely and install it again? (Ngnix+Certbot+Vaultwarden)

there is no need to reinstall stuff. Can you check what is failing on Nginx

systemctl restart nginx
journalctl -u nginx
-- Journal begins at Fri 2023-02-24 20:33:25 CET, ends at Fri 2023-02-24 22:13:16 CET. --
Feb 24 21:32:21 DietPi systemd[1]: Starting A high performance web server and a reverse proxy server...
Feb 24 21:32:21 DietPi nginx[604]: nginx: [emerg] "upstream" directive is not allowed here in /etc/nginx/sites-dietpi/vaultwarden.conf:5
Feb 24 21:32:21 DietPi nginx[604]: nginx: configuration file /etc/nginx/nginx.conf test failed
Feb 24 21:32:21 DietPi systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
Feb 24 21:32:21 DietPi systemd[1]: nginx.service: Failed with result 'exit-code'.
Feb 24 21:32:21 DietPi systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Feb 24 22:12:17 DietPi systemd[1]: Starting A high performance web server and a reverse proxy server...
Feb 24 22:12:17 DietPi nginx[2118]: nginx: [emerg] "upstream" directive is not allowed here in /etc/nginx/sites-dietpi/vaultwarden.conf:5
Feb 24 22:12:17 DietPi nginx[2118]: nginx: configuration file /etc/nginx/nginx.conf test failed
Feb 24 22:12:17 DietPi systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
Feb 24 22:12:17 DietPi systemd[1]: nginx.service: Failed with result 'exit-code'.
Feb 24 22:12:17 DietPi systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Feb 24 22:13:16 DietPi systemd[1]: Starting A high performance web server and a reverse proxy server...
Feb 24 22:13:16 DietPi nginx[2157]: nginx: [emerg] "upstream" directive is not allowed here in /etc/nginx/sites-dietpi/vaultwarden.conf:5
Feb 24 22:13:16 DietPi nginx[2157]: nginx: configuration file /etc/nginx/nginx.conf test failed
Feb 24 22:13:16 DietPi systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
Feb 24 22:13:16 DietPi systemd[1]: nginx.service: Failed with result 'exit-code'.
Feb 24 22:13:16 DietPi systemd[1]: Failed to start A high performance web server and a reverse proxy server.

you did not remove all configurations you did.

okay, but now it´s getting over my head. I dont know what to do, i think i messed it up.

remove the configuration file and restart Nginx

rm /etc/nginx/sites-dietpi/vaultwarden.conf
systemctl restart nginx

Thx! I´ve done it. Now Nginx is working

let’s verify LISTEN ports

ss -tulpn | grep LISTEN
tcp   LISTEN 0      32           0.0.0.0:53        0.0.0.0:*    users:(("pihole-FTL",pid=493,fd=5))                                      
tcp   LISTEN 0      1000         0.0.0.0:22        0.0.0.0:*    users:(("dropbear",pid=313,fd=4))                                        
tcp   LISTEN 0      256        127.0.0.1:5335      0.0.0.0:*    users:(("unbound",pid=498,fd=4))                                         
tcp   LISTEN 0      256        127.0.0.1:8953      0.0.0.0:*    users:(("unbound",pid=498,fd=6))                                         
tcp   LISTEN 0      511          0.0.0.0:443       0.0.0.0:*    users:(("nginx",pid=579,fd=8),("nginx",pid=578,fd=8),("nginx",pid=577,fd=8),("nginx",pid=576,fd=8),("nginx",pid=575,fd=8))
tcp   LISTEN 0      1024       127.0.0.1:8000      0.0.0.0:*    users:(("vaultwarden",pid=582,fd=34))                                    
tcp   LISTEN 0      5          127.0.0.1:4711      0.0.0.0:*    users:(("pihole-FTL",pid=493,fd=10))                                     
tcp   LISTEN 0      4096         0.0.0.0:9002      0.0.0.0:*    users:(("docker-proxy",pid=828,fd=4))                                    
tcp   LISTEN 0      511          0.0.0.0:80        0.0.0.0:*    users:(("nginx",pid=579,fd=5),("nginx",pid=578,fd=5),("nginx",pid=577,fd=5),("nginx",pid=576,fd=5),("nginx",pid=575,fd=5))
tcp   LISTEN 0      32              [::]:53           [::]:*    users:(("pihole-FTL",pid=493,fd=7))                                      
tcp   LISTEN 0      1000            [::]:22           [::]:*    users:(("dropbear",pid=313,fd=5))                                        
tcp   LISTEN 0      256            [::1]:8953         [::]:*    users:(("unbound",pid=498,fd=5))                                         
tcp   LISTEN 0      511             [::]:443          [::]:*    users:(("nginx",pid=579,fd=7),("nginx",pid=578,fd=7),("nginx",pid=577,fd=7),("nginx",pid=576,fd=7),("nginx",pid=575,fd=7))
tcp   LISTEN 0      5              [::1]:4711         [::]:*    users:(("pihole-FTL",pid=493,fd=15))                                     
tcp   LISTEN 0      4096            [::]:9002         [::]:*    users:(("docker-proxy",pid=835,fd=4))                                    
tcp   LISTEN 0      511             [::]:80           [::]:*    users:(("nginx",pid=579,fd=6),("nginx",pid=578,fd=6),("nginx",pid=577,fd=6),("nginx",pid=576,fd=6),("nginx",pid=575,fd=6))

Are you able to reach the Nginx default web site using https://your.domain.com from extern now?

Yes i´m able to reach it.

pls follow steps 5-9 now Confused Reverse proxy and vaultwarden - #21 by Joulinar

I did follow the steps, but Vaultwarden isn’t available from inside

How are you trying to reach Vaulwarden now? Can you check logs

journalctl -u vaultwarden.service
-- Journal begins at Sat 2023-02-25 01:10:41 CET, ends at Sat 2023-02-25 23:10:3 2 CET. --
Feb 25 01:11:23 DietPi systemd[1]: Started vaultwarden (DietPi).
Feb 25 01:11:23 DietPi vaultwarden[599]: /-------------------------------------- ------------------------------\
Feb 25 01:11:23 DietPi vaultwarden[599]: |                        Starting Vault warden                        |
Feb 25 01:11:23 DietPi vaultwarden[599]: |-------------------------------------- ------------------------------|
Feb 25 01:11:23 DietPi vaultwarden[599]: | This is an *unofficial* Bitwarden imp lementation, DO NOT use the   |
Feb 25 01:11:23 DietPi vaultwarden[599]: | official channels to report bugs/feat ures, regardless of client.   |
Feb 25 01:11:23 DietPi vaultwarden[599]: | Send usage/configuration questions or  feature requests to:         |
Feb 25 01:11:23 DietPi vaultwarden[599]: |   https://vaultwarden.discourse.group /                             |
Feb 25 01:11:23 DietPi vaultwarden[599]: | Report suspected bugs/issues in the s oftware itself at:            |
Feb 25 01:11:23 DietPi vaultwarden[599]: |   https://github.com/dani-garcia/vaul twarden/issues/new            |
Feb 25 01:11:23 DietPi vaultwarden[599]: \-------------------------------------- ------------------------------/
Feb 25 01:11:23 DietPi vaultwarden[599]: [INFO] No .env file found.
Feb 25 01:11:24 DietPi vaultwarden[599]: [2023-02-25 01:11:24.034][vaultwarden:: api::notifications][INFO] Starting WebSockets server on 0.0.0.0:3012
Feb 25 01:11:24 DietPi vaultwarden[599]: [2023-02-25 01:11:24.060][start][INFO]  Rocket has launched from http://127.0.0.1:8000
Feb 25 01:15:18 DietPi vaultwarden[599]: [2023-02-25 01:15:18.149][vaultwarden:: api::notifications][INFO] Accepting WS connection from 192.168.178.38:57605
Feb 25 01:15:18 DietPi vaultwarden[599]: [2023-02-25 01:15:18.168][vaultwarden:: api::notifications][INFO] Accepting WS connection from 192.168.178.38:57606
Feb 25 01:15:18 DietPi vaultwarden[599]: [2023-02-25 01:15:18.177][vaultwarden:: api::notifications][INFO] Accepting WS connection from 192.168.178.38:57607
Feb 25 01:15:18 DietPi vaultwarden[599]: [2023-02-25 01:15:18.187][vaultwarden:: api::notifications][INFO] Accepting WS connection from 192.168.178.38:57608
Feb 25 01:15:18 DietPi vaultwarden[599]: [2023-02-25 01:15:18.197][vaultwarden:: api::notifications][INFO] Accepting WS connection from 192.168.178.38:57609
Feb 25 01:15:18 DietPi vaultwarden[599]: [2023-02-25 01:15:18.206][vaultwarden:: api::notifications][INFO] Accepting WS connection from 192.168.178.38:57610
Feb 25 01:15:18 DietPi vaultwarden[599]: [2023-02-25 01:15:18.214][vaultwarden:: api::notifications][INFO] Accepting WS connection from 192.168.178.38:57611
Feb 25 01:15:18 DietPi vaultwarden[599]: [2023-02-25 01:15:18.221][vaultwarden:: api::notifications][INFO] Accepting WS connection from 192.168.178.38:57612
Feb 25 01:15:18 DietPi vaultwarden[599]: [2023-02-25 01:15:18.230][vaultwarden:: api::notifications][INFO] Accepting WS connection from 192.168.178.38:57613
Feb 25 01:15:18 DietPi vaultwarden[599]: [2023-02-25 01:15:18.241][vaultwarden:: api::notifications][INFO] Accepting WS connection from 192.168.178.38:57614
Feb 25 01:16:07 DietPi vaultwarden[599]: [2023-02-25 01:16:07.957][rocket::serve r][WARN] Received SIGTERM. Requesting shutdown.
Feb 25 01:16:07 DietPi systemd[1]: Stopping vaultwarden (DietPi)...
Feb 25 01:16:07 DietPi vaultwarden[599]: [2023-02-25 01:16:07.958][vaultwarden][ INFO] Vaultwarden process exited!
Feb 25 01:16:07 DietPi systemd[1]: vaultwarden.service: Succeeded.
Feb 25 01:16:07 DietPi systemd[1]: Stopped vaultwarden (DietPi).
Feb 25 01:16:07 DietPi systemd[1]: Started vaultwarden (DietPi).
Feb 25 01:16:08 DietPi vaultwarden[1865]: /------------------------------------- -------------------------------\
Feb 25 01:16:08 DietPi vaultwarden[1865]: |                        Starting Vaul twarden                        |
Feb 25 01:16:08 DietPi vaultwarden[1865]: |------------------------------------- -------------------------------|
Feb 25 01:16:08 DietPi vaultwarden[1865]: | This is an *unofficial* Bitwarden im plementation, DO NOT use the   |
Feb 25 01:16:08 DietPi vaultwarden[1865]: | official channels to report bugs/fea tures, regardless of client.   |
Feb 25 01:16:08 DietPi vaultwarden[1865]: | Send usage/configuration questions o r feature requests to:         |
Feb 25 01:16:08 DietPi vaultwarden[1865]: |   https://vaultwarden.discourse.grou p/                             |
Feb 25 01:16:08 DietPi vaultwarden[1865]: | Report suspected bugs/issues in the  software itself at:            |
Feb 25 01:16:08 DietPi vaultwarden[1865]: |   https://github.com/dani-garcia/vau ltwarden/issues/new            |
Feb 25 01:16:08 DietPi vaultwarden[1865]: \------------------------------------- -------------------------------/
Feb 25 01:16:08 DietPi vaultwarden[1865]: [INFO] No .env file found.
Feb 25 01:16:08 DietPi vaultwarden[1865]: [2023-02-25 01:16:08.113][vaultwarden: :api::notifications][INFO] Starting WebSockets server on 0.0.0.0:3012
Feb 25 01:16:08 DietPi vaultwarden[1865]: [2023-02-25 01:16:08.119][start][INFO]  Rocket has launched from http://127.0.0.1:8000
Feb 25 01:18:02 DietPi vaultwarden[1865]: [2023-02-25 01:18:02.532][vaultwarden: :api::notifications][INFO] Accepting WS connection from 192.168.178.38:57666
Feb 25 01:18:02 DietPi vaultwarden[1865]: [2023-02-25 01:18:02.541][vaultwarden: :api::notifications][INFO] Accepting WS connection from 192.168.178.38:57667
Feb 25 01:18:02 DietPi vaultwarden[1865]: [2023-02-25 01:18:02.549][vaultwarden: :api::notifications][INFO] Accepting WS connection from 192.168.178.38:57668
Feb 25 01:18:02 DietPi vaultwarden[1865]: [2023-02-25 01:18:02.555][vaultwarden: :api::notifications][INFO] Accepting WS connection from 192.168.178.38:57669
Feb 25 01:18:02 DietPi vaultwarden[1865]: [2023-02-25 01:18:02.562][vaultwarden: :api::notifications][INFO] Accepting WS connection from 192.168.178.38:57670
Feb 25 01:18:02 DietPi vaultwarden[1865]: [2023-02-25 01:18:02.571][vaultwarden: :api::notifications][INFO] Accepting WS connection from 192.168.178.38:57671
Feb 25 01:18:02 DietPi vaultwarden[1865]: [2023-02-25 01:18:02.577][vaultwarden: :api::notifications][INFO] Accepting WS connection from 192.168.178.38:57672
Feb 25 01:18:02 DietPi vaultwarden[1865]: [2023-02-25 01:18:02.586][vaultwarden: :api::notifications][INFO] Accepting WS connection from 192.168.178.38:57673
Feb 25 01:18:02 DietPi vaultwarden[1865]: [2023-02-25 01:18:02.592][vaultwarden: :api::notifications][INFO] Accepting WS connection from 192.168.178.38:57674
Feb 25 01:18:02 DietPi vaultwarden[1865]: [2023-02-25 01:18:02.601][vaultwarden: :api::notifications][INFO] Accepting WS connection from 192.168.178.38:57675
Feb 25 01:19:54 DietPi vaultwarden[1865]: [2023-02-25 01:19:54.390][vaultwarden: :api::notifications][INFO] Accepting WS connection from 192.168.178.38:57714
Feb 25 01:19:54 DietPi vaultwarden[1865]: [2023-02-25 01:19:54.397][vaultwarden: :api::notifications][INFO] Accepting WS connection from 192.168.178.38:57715
Feb 25 01:19:54 DietPi vaultwarden[1865]: [2023-02-25 01:19:54.405][vaultwarden: :api::notifications][INFO] Accepting WS connection from 192.168.178.38:57716
Feb 25 01:19:54 DietPi vaultwarden[1865]: [2023-02-25 01:19:54.413][vaultwarden: :api::notifications][INFO] Accepting WS connection from 192.168.178.38:57717
Feb 25 01:19:54 DietPi vaultwarden[1865]: [2023-02-25 01:19:54.422][vaultwarden: :api::notifications][INFO] Accepting WS connection from 192.168.178.38:57718
Feb 25 01:19:54 DietPi vaultwarden[1865]: [2023-02-25 01:19:54.430][vaultwarden: :api::notifications][INFO] Accepting WS connection from 192.168.178.38:57719
Feb 25 01:19:54 DietPi vaultwarden[1865]: [2023-02-25 01:19:54.438][vaultwarden: :api::notifications][INFO] Accepting WS connection from 192.168.178.38:57720
Feb 25 01:19:54 DietPi vaultwarden[1865]: [2023-02-25 01:19:54.445][vaultwarden: :api::notifications][INFO] Accepting WS connection from 192.168.178.38:57721
Feb 25 01:19:54 DietPi vaultwarden[1865]: [2023-02-25 01:19:54.453][vaultwarden: :api::notifications][INFO] Accepting WS connection from 192.168.178.38:57722
Feb 25 01:19:54 DietPi vaultwarden[1865]: [2023-02-25 01:19:54.460][vaultwarden: :api::notifications][INFO] Accepting WS connection from 192.168.178.38:57723
Feb 25 01:46:30 DietPi vaultwarden[1865]: [2023-02-25 01:46:30.349][vaultwarden: :api::notifications][INFO] Accepting WS connection from 192.168.178.30:60740
Feb 25 01:46:30 DietPi vaultwarden[1865]: [2023-02-25 01:46:30.362][vaultwarden: :api::notifications][INFO] Accepting WS connection from 192.168.178.30:60752
Feb 25 01:46:30 DietPi vaultwarden[1865]: [2023-02-25 01:46:30.381][vaultwarden: :api::notifications][INFO] Accepting WS connection from 192.168.178.30:60762
Feb 25 01:46:31 DietPi vaultwarden[1865]: [2023-02-25 01:46:31.489][vaultwarden: :api::notifications][INFO] Accepting WS connection from 192.168.178.30:60770
Feb 25 01:46:31 DietPi vaultwarden[1865]: [2023-02-25 01:46:31.489][vaultwarden: :api::notifications][INFO] Accepting WS connection from 192.168.178.30:60772
Feb 25 01:46:36 DietPi vaultwarden[1865]: [2023-02-25 01:46:36.536][vaultwarden: :api::notifications][INFO] Accepting WS connection from 192.168.178.30:43240
Feb 25 01:46:36 DietPi vaultwarden[1865]: [2023-02-25 01:46:36.558][vaultwarden: :api::notifications][INFO] Accepting WS connection from 192.168.178.30:43252
Feb 25 20:11:28 DietPi vaultwarden[1865]: [2023-02-25 20:11:28.658][vaultwarden: :api::notifications][INFO] Accepting WS connection from 192.168.178.30:36654
Feb 25 20:11:28 DietPi vaultwarden[1865]: [2023-02-25 20:11:28.662][vaultwarden: :api::notifications][INFO] Accepting WS connection from 192.168.178.30:36668
Feb 25 20:11:29 DietPi vaultwarden[1865]: [2023-02-25 20:11:29.895][vaultwarden: :api::notifications][INFO] Accepting WS connection from 192.168.178.30:36670