diff --git a/roles/gitea/templates/apache2-vhost-ssl.conf b/roles/gitea/templates/apache2-vhost-ssl.conf
index 36c655b..c0f7337 100644
--- a/roles/gitea/templates/apache2-vhost-ssl.conf
+++ b/roles/gitea/templates/apache2-vhost-ssl.conf
@@ -25,18 +25,6 @@ SSLProxyEngine on
AllowOverride All
Options MultiViews FollowSymlinks
-
- RequestHeader set X_FORWARDED_PROTO 'https'
- RequestHeader set X-Forwarded-Ssl on
-
-
- SSLEngine on
- SSLCertificateFile /etc/pki/cert/crt/{{ gitea_url }}.crt
- SSLCertificateKeyFile /etc/pki/cert/private/{{ gitea_url }}.key
- SSLCertificateChainFile /etc/pki/cert/crt/{{ gitea_url }}-fullchain.crt
- SSLProtocol {{ ssl_protocol }}
- SSLCipherSuite {{ ssl_cipher_suite }}
- ServerName {{ gitea_url }}
ProxyPreserveHost On
ProxyRequests Off
ProxyPass / http://127.0.0.1:3000/ nocanon retry=1
diff --git a/roles/matrix/templates/apache2-vhost-ssl.conf b/roles/matrix/templates/apache2-vhost-ssl.conf
index 226230f..8de69a7 100644
--- a/roles/matrix/templates/apache2-vhost-ssl.conf
+++ b/roles/matrix/templates/apache2-vhost-ssl.conf
@@ -25,6 +25,17 @@ SSLProxyEngine on
AllowOverride All
Options MultiViews FollowSymlinks
+ RequestHeader set X_FORWARDED_PROTO 'https'
+ RequestHeader set X-Forwarded-Ssl on
+
+
+ SSLEngine on
+ SSLCertificateFile /etc/pki/cert/crt/{{ matrix_url }}.crt
+ SSLCertificateKeyFile /etc/pki/cert/private/{{ matrix_url }}.key
+ SSLCertificateChainFile /etc/pki/cert/crt/{{ matrix_url }}-fullchain.crt
+ SSLProtocol {{ ssl_protocol }}
+ SSLCipherSuite {{ ssl_cipher_suite }}
+ ServerName {{ matrix_url }}
ProxyPreserveHost On
ProxyRequests Off
ProxyPass / http://127.0.0.1:8008/ nocanon retry=1