Files
configpolicy/roles/bitwarden_rs/templates/bitwarden.httpd.conf.j2
Dustin C. Hatch 7e8aee072e 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.
2024-11-05 06:37:03 -06:00

32 lines
942 B
Django/Jinja

RewriteEngine On
RewriteCond %{HTTPS} !on
RewriteRule /.* https://%{SERVER_NAME}$0
<VirtualHost _default_:443>
Include conf.d/ssl.include
SSLCertificateFile {{ apache_ssl_certificate }}
SSLCertificateKeyFile {{ apache_ssl_certificate_key }}
SSLCertificateChainFile {{ apache_ssl_certificate }}
{% if apache_ssl_ca_certificate is defined %}
SSLCACertificateFile {{ apache_ssl_ca_certificate }}
{% endif %}
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]
ProxyPreserveHost On
ProxyRequests Off
ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/
RequestHeader set X-Real-IP %{REMOTE_ADDR}s
</VirtualHost>