我正在使用GitLab CE作为我的公司开发存储库,我想使用gitlab-pages来提供一些静态文档。
我为页面设置了CI集成,它可以工作(我可以在项目“Pages”设置中查看网站地址,CI工作正常)
我正在使用apache 2作为反向代理,因此禁用了NGINX,配置了DNS:“docs.example.org”的CNAME记录和“* .docs.example.org”的A记录,两者都指向gitlab服务器,名为Ulysse。
DNS中的Gitlab服务器记录是“gitlab.example.org”,它通过带有VirtualHost配置的apache提供。
如何设置apache来为这些页面提供服务?
感谢您的帮助!
答案 0 :(得分:0)
我认为我尝试使用相同的IP在gitlab所在的服务器上提供服务,apache2用作带有通配符虚拟主机的负载均衡器。 (官方文档中的第三个案例:https://docs.gitlab.com/ee/administration/pages/index.html)
我为apache2创建了一个新的gitlab-pages.conf文件:
<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>
此作品几乎:http://[user].docs.example.org/[project]/网站通过将RELATIVE_URLS = True
设置为SSG(在我的情况下为perlican)提供服务,但在Project&gt;中显示的域地址设置&gt;页面不是。