ok I was playing with it an this one was working for me
$HTTP["host"] == "demo.com" {
$HTTP["url"] =~ "^/notifications/hub($|/)" {
# WebSocket proxy
proxy.server = ( "" => ("vaultwarden" => ( "host" => "192.168.0.x", "port" => 3012 )))
proxy.forwarded = ( "for" => 1 )
proxy.header = (
"upgrade" => "enable",
"connect" => "enable"
)
} else {
$HTTP["url"] =~ "^/vault($|/)" {
proxy.server = ( "" => ("vaultwarden" => ( "host" => "192.168.0.x", "port" => 8001 )))
proxy.forwarded = ( "for" => 1 )
}
}
}
Now I’m able to access vaultwarden using http://demo.com/vault/
The trailing slash still something to be added within the URL