Acces admin page of vaultwarden

Hello,

I have installed vaultwarden by compiling from source code on debian 11.x on a vritual machine, i don’t know if i have made a mistake in the nginx configuration. The ip of the machine is 192.168.0.66, when i try to access this ip i have just the nginx working page.

In the first step vaultwarden has been installed in /opt/vaultwarden

I had created the following file for the virtualhost /etc/nginx/sites-available/vaultwarden with the following content :

 server {
    listen 80;
    listen [::]:80;
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name vaultwarden;

    access_log /var/log/nginx/vaultwarden.access.log;
    error_log /var/log/nginx/vaultwarden.error.log;

   ssl_certificate      /etc/letsencrypt/live/vaultwarden/fullchain.pem;
    ssl_certificate_key  /etc/letsencrypt/live/vaultwarden/privkey.pem;

    ssl_session_timeout 5m;
    ssl_session_cache shared:SSL:5m;

    ssl_prefer_server_ciphers On;
    ssl_protocols TLSv1.2;
    ssl_ciphers 'EECDH+aRSA+AESGCM:EECDH+aRSA+SHA384:EECDH+aRSA+SHA256:EECDH:+CAMELLIA256:+AES256:+CAMELLIA128:+AES128:+SSLv3:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!DSS:!RC4:!SEED:!ECDSA';

    ssl_dhparam /etc/ssl/private/dhparam4096.pem;
    add_header Strict-Transport-Security max-age=15768000; # six months
    gzip off;

    if ($https != 'on') {
        rewrite ^/(.*)$ https://vaultwarden.example.org/$1 permanent;
    }

    root /var/www/html;

    # Allow large attachments
    client_max_body_size 128M;

    location ^~ '/.well-known/acme-challenge' {
        default_type "text/plain";
        root /var/www/certbot;
    }

    location / {
        include /etc/nginx/proxy_params;
        ## /etc/nginx/proxy_params contient normalement ceci :
        #proxy_set_header Host $http_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://127.0.0.1:8000;
    }

    location /notifications/hub {
        include /etc/nginx/proxy_params;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_pass http://127.0.0.1:3012;
    }

    location /notifications/hub/negotiate {
        include /etc/nginx/proxy_params;
        proxy_pass http://127.0.0.1:8000;
    }
}

What is wrong in my install ?

Not sure if you have enabled the site… Did you link the /etc/nginx/sites-available/vaultwarden to /etc/nginx/sites-enabled/vaultwarden so this configuration becomes active?

If not, you should run the following:

cd /etc/nginx/sites-enabled/
sudo ln -s ../sites-available/vaultwarden .
sudo nginx -s reload

Hello,

I have tried but it doen’t find the file for the certifcate :

root@debianVautlwarden:/etc/nginx/sites-enabled# ln -s ../sites-available/vaultwarden .
root@debianVautlwarden:/etc/nginx/sites-enabled# nginx -s reload
nginx: [emerg] cannot load certificate "/etc/letsencrypt/live/vaultwarden/fullchain.pem": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/etc/letsencrypt/live/vaultwarden/fullchain.pem','r') error:2006D080:BIO routines:BIO_new_file:no such file)
root@debianVautlwarden:/etc/nginx/sites-enabled#

I’am using vaulwarden locally so i don’t have a domain name