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.
This commit is contained in:
1
roles/bitwarden_rs/defaults/main.yml
Normal file
1
roles/bitwarden_rs/defaults/main.yml
Normal file
@@ -0,0 +1 @@
|
||||
bitwarden_domain: https://{{ bitwarden_host }}
|
||||
@@ -16,6 +16,10 @@ Header always set \
|
||||
Strict-Transport-Security "max-age=63072000; includeSubDomains"
|
||||
|
||||
RewriteEngine On
|
||||
{% if bitwarden_host is defined %}
|
||||
RewriteCond %{SERVER_NAME} !{{ bitwarden_host }}
|
||||
RewriteRule /.* https://{{ bitwarden_host }}$0
|
||||
{% endif %}
|
||||
RewriteCond %{HTTP:Upgrade} =websocket [NC]
|
||||
RewriteRule /notifications/hub(.*) ws://localhost:3012/$1 [QSA,P,L]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user