NginxProxyManager和Vaultwarden结合

之前翻这玩意的文档翻得太累了,搞了一大轮才明白这玩意到底该怎么配。

如果你不需要使用 Vaultwarden 的自动同步,那么你直接无脑写了Forward Hostname/IP和端口就可以了,并不需要下面的设置。

启用 Vaultwarden 的 WebSocket

Vaultwarden 的 websocket 服务器默认是关闭的,这个地方坑了我几轮,后面才发现这个配置是必须的。

只需要在 docker 的环境变量中添加WEBSOCKET_ENABLED=true即可。

在 NginxProxyManager 中配置 Vaultwarden

Detail 部分不用说了,直接写就完事了,这个是额外需要添加的部分。

由于 Vaultwarden 的 websocket 服务器是运行在另一个端口 3012 上,并没有和网站的 80 端口合并,所以产生了这个配置的需求。

首先是在Detail中把Websockets Support打开,

然后在Custom locations中添加如下配置:

1.

1
2
3
4
Define location `/notifications/hub`
Scheme `http`
Forward Hostname / IP `你的服务器的IP地址`
Forward Port `3012`

2.

1
2
3
4
Define location `/notifications/hub/negotiate`
Scheme `http`
Forward Hostname / IP `你的服务器的IP地址`
Forward Port `80`

就这样。