我刚刚尝试将 GitLab 安装到我的根服务器。
但是当我使用 Apache 作为代理访问网页时,我收到“503 服务不可用”消息。
这是我的 Apache VirtualHost 配置文件:
<VirtualHost *:80>
ServerName git.example.at
DocumentRoot /opt/gitlab/embedded/service/gitlab-rails/public/
<Directory /opt/gitlab/embedded/service/gitlab-rails/public/>
Require all granted
</Directory>
ProxyPreserveHost On
AllowEncodedSlashes Off
<Location />
Order deny,allow
Allow from all
ProxyPassReverse http://127.0.0.1:8080
ProxyPassReverse http://git.example.at/
</Location>
RewriteEngine on
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule .* http://127.0.0.1:8080%{REQUEST_URI} [P,QSA]
</VirtualHost>
完整gitlab.rb
配置文件可以在 Pastebin 上找到。
答案1
在您的 Apache VirtualHost 配置中,两行内容如下ProxyPassReverse
:
<Location />
Order deny,allow
Allow from all
ProxyPassReverse http://127.0.0.1:8080
ProxyPassReverse http://git.example.at/
</Location>
我认为应该是:
<Location />
Order deny,allow
Allow from all
ProxyPass / http://127.0.0.1:8080
ProxyPassReverse http://git.example.at/
</Location>