I am hosting Gitlab on digital ocean and I have setup Gitlab to use Apache. When I create a VirtualHost for gitlab I get SSL. It works when
VirtualHost is set to <VirtualHost *:80>
but then when I change it to my domain I get an error in chrome saying ERR_SSL_PROTOCOL_ERROR
. Below is my configuration, I don't understand why it doesn't work. I'm no expert in Apache and this is the configuration that I got on the Gitlab website for Apache.
<VirtualHost example.com:80>
ServerName example.com
ServerSignature Off
RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [NE,R,L]
</VirtualHost>
<VirtualHost example.com:443>
SSLEngine on
SSLHonorCipherOrder on
SSLCipherSuite "ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS"
Header add Strict-Transport-Security: "max-age=15768000;includeSubdomains"
SSLCompression Off
SSLCertificateFile /etc/letsencrypt/live/example.com/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem
SSLCACertificateFile /etc/letsencrypt/live/example.com/chain.pem
ServerName example.com
ServerSignature Off
ProxyPreserveHost On
AllowEncodedSlashes NoDecode
<Location />
Require all granted
ProxyPassReverse http://127.0.0.1:8181
ProxyPassReverse http://example.com
</Location>
RewriteEngine on
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f [OR]
RewriteCond %{REQUEST_URI} ^/uploads/.*
RewriteRule .* http://127.0.0.1:8181%{REQUEST_URI} [P,QSA,NE]
RequestHeader set X_FORWARDED_PROTO 'https'
RequestHeader set X-Forwarded-Ssl on
DocumentRoot /opt/gitlab/embedded/service/gitlab-rails/public
</VirtualHost>
I want to set multiple sites up on the same server and I only want to get to my gitlab server with a certain domain, which is why I am setting this up in Apache