0

I’m using GitLab CE as my company development repository, and I’ld like to use gitlab-pages to serve some static docs.

I’ve setup CI integration for pages, and it works (I can see site address in the project “Pages” settings, CI job is OK)

I’m using apache 2 as reverse proxy, so NGINX is disabled, DNS is configured : CNAME record for “docs.example.org” and A record for “*.docs.example.org”, both pointing to the gitlab server, named Ulysse.

The Gitlab server record in the DNS is “gitlab.example.org”, it’s served through apache with a VirtualHost configuration.

How can I set-up apache to serve those pages ?

Thanks fo your help !

frague
  • 189
  • 1
  • 10
  • What have you tried so far to attempt to get things up and running? – ajtrichards Sep 25 '17 at 06:56
  • I think I've to write an apache config file for this, but I haven't found any examples for a such config file. The gitlab-pages application is listenning on 127.0.0.1:8090 address. The GitLab instance is working nicely. – frague Sep 25 '17 at 08:45

1 Answers1

1

I assume that I'm trying to serve the pages on the same server than gitlab with the same IP, apache2 is used as load balancer with a wild-card virtualhost. (Third case in the official doc: https://docs.gitlab.com/ee/administration/pages/index.html)

I've created a new gitlab-pages.conf file for apache2:

<VirtualHost *:80>
    ServerName docs.example.org
    ServerAlias *.docs.example.org

    ProxyPreserveHost On
    ProxyPass "/" "http://127.0.0.1:8090/"
    ProxyPassReverse "/" "http://127.0.0.1:8090/

    RewriteEngine on
    RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
    RewriteRule .* http://127.0.0.1:8090%{REQUEST_URI} [P,QSA]

</VirtualHost>

This works almost : the http://[user].docs.example.org/[project]/ sites are served with setting the RELATIVE_URLS = True to the SSG (perlican in my case), but domain address displayed in Project > Settings > Pages are not.

frague
  • 189
  • 1
  • 10