r/bitwarden_rs: Redirect to canonical host name

Bitwarden has not worked correctly for clients using the non-canonical
domain name (i.e. _bitwarden.pyrocufflink.blue_) for quite some time.
This still trips me up occasionally, though, so hopefully adding a
server-side redirect will help.  Eventually, I'll probably remove the
non-canonical name entirely.
dynamic-inventory
Dustin 2024-11-05 06:37:03 -06:00
parent 0807afde57
commit 7e8aee072e
3 changed files with 6 additions and 1 deletions

View File

@ -1,4 +1,4 @@
bitwarden_domain: https://bitwarden.pyrocufflink.net bitwarden_host: bitwarden.pyrocufflink.net
burp_backup_script_pre: /etc/burp/backup-pre.sh burp_backup_script_pre: /etc/burp/backup-pre.sh
burp_backup: burp_backup:
- include: /var/lib/vaultwarden/data - include: /var/lib/vaultwarden/data

View File

@ -0,0 +1 @@
bitwarden_domain: https://{{ bitwarden_host }}

View File

@ -16,6 +16,10 @@ Header always set \
Strict-Transport-Security "max-age=63072000; includeSubDomains" Strict-Transport-Security "max-age=63072000; includeSubDomains"
RewriteEngine On RewriteEngine On
{% if bitwarden_host is defined %}
RewriteCond %{SERVER_NAME} !{{ bitwarden_host }}
RewriteRule /.* https://{{ bitwarden_host }}$0
{% endif %}
RewriteCond %{HTTP:Upgrade} =websocket [NC] RewriteCond %{HTTP:Upgrade} =websocket [NC]
RewriteRule /notifications/hub(.*) ws://localhost:3012/$1 [QSA,P,L] RewriteRule /notifications/hub(.*) ws://localhost:3012/$1 [QSA,P,L]