Skip to content

Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.

1.5 KB
Raw Blame
server {
    listen 80;
    server_name _;
    root /usr/share/nginx/html;
    index index.html;

    # Docusaurus emits clean URLs as directories with an index.html, plus
    # standalone .html files (e.g. the legacy redirect pages). Try the exact
    # file, then the directory index, then a .html sibling, before 404.
    location / {
        try_files $uri $uri/ $uri.html =404;
    }

    # Redirects (can be deleted later once all dependent content has been updated):
    # The single security architecture diagram moved to the whitepaper diagrams in 0.31.0; keep old links working.
    location ~ ^/assets/diagrams/security-architecture/aliasvault-security-architecture(?<suffix>-dark\.svg|-light\.svg|-thumb\.jpg|\.html|\.drawio)$ {
        absolute_redirect off;
        return 301 /assets/diagrams/whitepaper/1-architecture-overview$suffix;
    }

    # Long-cache fingerprinted static assets.
    location /assets/ {
        try_files $uri =404;
        expires 7d;
        add_header Cache-Control "public";
    }

    # Docusaurus content-hashed bundles can be cached aggressively.
    location ~* \.(?:js|css|woff2?|svg|png|jpg|jpeg|gif|ico)$ {
        expires 30d;
        add_header Cache-Control "public, immutable";
    }

    error_page 404 /404.html;

    # Basic security headers.
    add_header X-Content-Type-Options "nosniff" always;
    add_header X-Frame-Options "SAMEORIGIN" always;
    add_header Referrer-Policy "strict-origin-when-cross-origin" always;
}