直接上docker-compose

version: '3'

services:
  bitwarden:
    image: vaultwarden/server:latest
    container_name: bitwarden
    restart: unless-stopped
    volumes:
      - /bp:/data/
    environment:
      - WEBSOCKET_ENABLED=true
      - SIGNUPS_ALLOWED=false
      - WEB_VAULT_ENABLED=true
      - ADMIN_TOKEN=xxxxx
    ports:
      - "127.0.0.1:8090:80"
      - "127.0.0.1:9090:3012"

下面是nginx配置

server{
    listen 80;
    index index;
    server_name bitwarden.heihei.com;

    location / 
    {
        proxy_redirect off;
        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_pass http://127.0.0.1:8090;
    }
   # notification
    location /notifications/hub {
        proxy_pass http://127.0.0.1:9090;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }
   # notification
    location /notifications/hub/negotiate {
        proxy_pass http://127.0.0.1:8090;
    } 
    location ~ .*\.(php|jsp|cgi|asp|aspx|flv|swf|xml)?$
    { 
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_pass http://localhost:8090;
        
    }
    access_log  /tmp/log/nginx-bitwarden.log;
}