Custom domain (subdomain) with pages
Hi all,
I'm in quite a bit of confusion about how to properly setup Gitlab pages on my custom domain.
Note IP's and domains were swapped out for stubs.
My setup is currently this:
-
gitlab.mydomain.tld-> resolves to10.0.0.10 -
10.0.0.10runs Apache with reveres proxy + lets encrypt to10.0.0.50. - Gitlab omnibus (up to date 9.0.2) runs on
10.0.0.50. - In this setup, Gitlab itself works perfectly, and always has.
Currently, I'm trying to setup gitlab pages, and having no success.
I created a wildcard `A` record like so:
`*.pages.mydomain.tld` -> `10.0.0.10`
As per the Youtube video Matija created, I then set the gitlab.rb with these values:
##! Define to enable GitLab Pages
pages_external_url "http://pages.mydomain.tld"
#gitlab_pages['enable'] = true
I then reconfigured gitlab, and the pages area of projects still says:
Support for domains and certificates is disabled. Ask your system's administrator to enable it.
Using gitlab-ctl, everything is up.
For full details, i've included my vhost config:
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerAdmin webmaster@localhost
ServerName gitlab.mydomain.tld
SSLEngine On
SSLCertificateChainFile /etc/letsencrypt/live/gitlab.mydomain.tld/fullchain.pem
SSLCertificateFile /etc/letsencrypt/live/gitlab.mydomain.tld/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/gitlab.mydomain.tld/privkey.pem
ProxyRequests Off
ProxyPreserveHost On
ProxyPass / http://10.0.0.50/
ProxyPassReverse / http://10.0.0.50/
RequestHeader set X-FORWARDED-PROTOCOL https
RequestHeader set X-Forwarded-Ssl on
</VirtualHost>
</IfModule>
<VirtualHost *:80>
ServerName gitlab.mydomain.tld
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI}
RequestHeader set X-FORWARDED-PROTOCOL https
RequestHeader set X-Forwarded-Ssl on
#Redirect permanent / https://gitlab.mydomain.tld/
</VirtualHost>
And also the pages vhost:
<VirtualHost *:80>
ServerName pages.mydomain.tld
ServerAlias *.pages.mydomain.tld
ProxyRequests Off
ProxyPreserveHost On
ProxyPass / http://10.0.0.50/
ProxyPassReverse / http://10.0.0.50/
</VirtualHost>