aboutsummaryrefslogblamecommitdiff
path: root/files/usr/local/etc/nginx/vhosts.conf.bitwarden_server
blob: 0ef31bb846320cc299d71f363d85e67ddd4854c4 (plain) (tree)



































                                                                 
upstream vaultwarden {
  zone vaultwarden 64k;
  server 127.0.0.1:${vaultwarden_port};
  keepalive 2;
}

map \$http_upgrade \$connection_upgrade {
  default upgrade;
  ''      "";
}

server {
  listen 443      ssl default_server;
  listen [::]:443 ssl default_server;
  http2 on;

  client_max_body_size 256M;

  ssl_certificate      ${vaultwarden_https_cert};
  ssl_certificate_key  ${vaultwarden_https_key};

  add_header Strict-Transport-Security "max-age=63072000" always;

  location / {
    proxy_http_version 1.1;
    proxy_set_header Upgrade \$http_upgrade;
    proxy_set_header Connection \$connection_upgrade;

    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://vaultwarden/;
  }
}