我无法修复由 Apache 2.4 代理的 Gitlab 上的图标。我的失败可能是因为我没有使用乘客(乘客提供了自己的一组更深层次的问题),但我采取了所有步骤在代理下运行它/gitlab
。我也跑了:
sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production RAILS_RELATIVE_URL_ROOT=/gitlab
我也重新启动了 Apache。没提升。图标仍然丢失(或者我应该说字体woff
文件返回status 200
到浏览器但大小为 0)。这是 Gitlab 6.5。在我的 Apache SSL sites-enabled
conf 文件中,这为我们的 Gitlab 提供了通往世界的 SSL 路由:
<Proxy *>
Require all granted
</Proxy>
<Location ~ /(gitlab|assets)>
RequestHeader set X_FORWARDED_PROTO 'https'
SetEnv RAILS_RELATIVE_URL_ROOT "/gitlab"
Require all granted
Options -Multiviews
# apache equivalent of nginx try files
# http://serverfault.com/questions/290784/what-is-apaches-equivalent-of-nginxs-try-files
# https://stackoverflow.com/questions/10954516/apache2-proxypass-for-rails-app-gitlab
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule .* http://127.0.0.1:8085/%{REQUEST_URI} [P,QSA]
# needed for downloading attachments but does not work under Location directive
#DocumentRoot /home/git/gitlab/public
</Location>
ProxyPass /gitlab/ http://127.0.0.1:8085/gitlab/
ProxyPassReverse /gitlab/ http://127.0.0.1:8085/gitlab/
ProxyPass /gitlab http://127.0.0.1:8085/gitlab
ProxyPassReverse /gitlab http://127.0.0.1:8085/gitlab
# SOme of the CSS assets were not being generated with "/gitlab", so I proxy those too.
ProxyPass /assets http://127.0.0.1:8085/gitlab/assets
ProxyPassReverse /assets http://127.0.0.1:8085/gitlab/assets
同样,大部分都可以正常工作。只有字体资源以 0 大小返回给浏览器。我应该将 Location 指令更新为目录吗?
注意: gitlab - 用矩形替换的图标没有帮助。是的,我的服务器上的 443 端口上还有其他站点,所以如果我不需要,我不能只在它自己的端口/域上使用这个 Apache 配置。我可能只需要一些帮助来理解 Apache 2.4。我的 Apache 配置中是否缺少任何内容?
资源使用: https://github.com/gitlabhq/gitlab-recipes/commit/be95bd4f9bd3244641a4c7e55eb75fcc29129ffd , https://github.com/gitlabhq/gitlabhq/issues/2365 , https://github.com/gitlabhq/gitlab -食谱/提交/c6c22b4fb68bbb6efb547cce6605dea4344ba9fe
替换 Location 指令也失败了:试过这个,但没有成功:
Alias ^/(gitlab|assets) /home/git/gitlab/public
<Directory /home/git/gitlab/public>`
RequestHeader set X_FORWARDED_PROTO 'https'
SetEnv RAILS_RELATIVE_URL_ROOT "/gitlab"
Require all granted
Options -Multiviews
# https://stackoverflow.com/questions/10954516/apache2-proxypass-for-rails-app-gitlab
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule .* http://127.0.0.1:8085/%{REQUEST_URI} [P,QSA]
</Directory>