dani-garcia / vaultwarden

Unofficial Bitwarden compatible server written in Rust, formerly known as bitwarden_rs
GNU Affero General Public License v3.0
36.3k stars 1.76k forks source link

Bitwarden_rs Support for Subpaths,how to config (caddy) ? #767

Closed bigbighill closed 4 years ago

bigbighill commented 4 years ago

docker-compose.yml

version: '3' services: bitwarden: image: bitwardenrs/server:latest container_name: bitwarden restart: always volumes:

Caddyfile https://www.xxxx.com { tls asdf@gmail.com root /var/www index index.html gzip header / {

Enable HTTP Strict Transport Security (HSTS)

    Strict-Transport-Security "max-age=31536000;"
    # Enable cross-site filter (XSS) and tell browser to block detected attacks
    X-XSS-Protection "1; mode=block"
    # Disallow the site to be rendered within a frame (clickjacking protection)
    X-Frame-Options "DENY"
    # Prevent search engines from indexing (optional)
    X-Robots-Tag "none"
}
    proxy /subpath/notifications/hub/negotiate bitwarden:80 {
    transparent
}
proxy /subpath notifications/hub bitwarden:3012 {
    websocket
}   
proxy /subpath bitwarden:80 {
    transparent
}

}

https://www.xxxx.com/subpath 404 error

https://github.com/bitwarden/server/issues/277 now support subpaths ,how to config?

thanks

bigbighill commented 4 years ago

@dani-garcia

fbartels commented 4 years ago

The linked issue says:

https://github.com/bitwarden/server/issues/277#issuecomment-386843238

Yes, running Bitwarden under a domain subfolder is not a supported scenario.

The linked issues also has a reference back to this project: https://github.com/dani-garcia/bitwarden_rs/issues/528

BlackDex commented 4 years ago

@bigbighill This is not supported by this project or by the upstream bitwarden.com project. There are some workarounds which could work but that means you need to compile the web-vault your self. See #241 . But there is no guarantee given for that to keep working.

dani-garcia commented 4 years ago

I think this is answered already, subpaths are not supported though they can be made to work with the patches mentioned above, that requires recompiling the web vault and the server yourself.

I would personally save myself the trouble and run it in a separate subdomain or under a different port.