gitlab apacheredirect循环

我正在尝试设置与Apache作为Web服务器的gitlab。 因此,我一直没有成功。 sidekiq和独angular兽开始很好,但是当我尝试访问根站点时,我被redirect到/ users / login并进入循环。

我使用Apache 2.2和gitlab 6.5。

我的Apacheconfiguration:

#This configuration has been tested on GitLab 6.0.0 and GitLab 6.0.1 #Note this config assumes unicorn is listening on default port 8080. #Module dependencies # mod_rewrite # mod_proxy # mod_proxy_http <VirtualHost *:80> ServerName gitlab.martijn.osbournia.com ServerSignature Off ProxyPreserveHost On <Location /> Order allow,deny Allow from all ProxyPassReverse http://127.0.0.1:8081 ProxyPassReverse http://gitlab.martijn.osbournia.com/ </Location> #apache equivalent of nginx try files # http://serverfault.com/questions/290784/what-is-apaches-equivalent-of-nginxs-try-files # http://stackoverflow.com/questions/10954516/apache2-proxypass-for-rails-app-gitlab RewriteEngine on RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f RewriteRule .* http://127.0.0.1:8081%{REQEST_URI} [P,QSA] # needed for downloading attachments DocumentRoot /home/gitlab_martijn/gitlab/public #Set up apache error documents, if back end goes down (ie 503 error) then a maintenance/deploy page is thrown up. ErrorDocument 404 /404.html ErrorDocument 422 /422.html ErrorDocument 500 /500.html ErrorDocument 503 /deploy.html LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b" common_forwarded ErrorLog /var/log/apache2/gitlab.martijn.osbournia.com_error.log CustomLog /var/log/apache2/gitlab.martijn.osbournia.com_forwarded.log common_forwarded CustomLog /var/log/apache2/gitlab.martijn.osbournia.com_access.log combined env=!dontlog CustomLog /var/log/apache2/gitlab.martijn.osbournia.com.log combined </VirtualHost> 

独立页面请求的Gitlab /独angular兽生产日志:

 Started GET "/" for 77.168.84.58 at 2014-02-17 12:10:00 +0100 Processing by DashboardController#show as HTML Completed 401 Unauthorized in 1ms Started GET "/" for 77.168.84.58 at 2014-02-17 12:10:00 +0100 Processing by DashboardController#show as HTML Completed 401 Unauthorized in 1ms Started GET "/" for 77.168.84.58 at 2014-02-17 12:10:00 +0100 Processing by DashboardController#show as HTML Completed 401 Unauthorized in 1ms Started GET "/" for 77.168.84.58 at 2014-02-17 12:10:00 +0100 Processing by DashboardController#show as HTML Completed 401 Unauthorized in 1ms Started GET "/" for 77.168.84.58 at 2014-02-17 12:10:00 +0100 Processing by DashboardController#show as HTML Completed 401 Unauthorized in 1ms Started GET "/" for 77.168.84.58 at 2014-02-17 12:10:00 +0100 Processing by DashboardController#show as HTML Completed 401 Unauthorized in 1ms Started GET "/" for 77.168.84.58 at 2014-02-17 12:10:00 +0100 Processing by DashboardController#show as HTML Completed 401 Unauthorized in 1ms Started GET "/" for 77.168.84.58 at 2014-02-17 12:10:00 +0100 Processing by DashboardController#show as HTML Completed 401 Unauthorized in 2ms Started GET "/" for 77.168.84.58 at 2014-02-17 12:10:01 +0100 Processing by DashboardController#show as HTML Completed 401 Unauthorized in 1ms Started GET "/" for 77.168.84.58 at 2014-02-17 12:10:01 +0100 Processing by DashboardController#show as HTML Completed 401 Unauthorized in 1ms Started GET "/" for 77.168.84.58 at 2014-02-17 12:10:01 +0100 Processing by DashboardController#show as HTML Completed 401 Unauthorized in 2ms Started GET "/" for 77.168.84.58 at 2014-02-17 12:10:01 +0100 Processing by DashboardController#show as HTML Completed 401 Unauthorized in 1ms Started GET "/" for 77.168.84.58 at 2014-02-17 12:10:01 +0100 Processing by DashboardController#show as HTML Completed 401 Unauthorized in 2ms Started GET "/" for 77.168.84.58 at 2014-02-17 12:10:01 +0100 Processing by DashboardController#show as HTML Completed 401 Unauthorized in 1ms Started GET "/" for 77.168.84.58 at 2014-02-17 12:10:01 +0100 Processing by DashboardController#show as HTML Completed 401 Unauthorized in 1ms Started GET "/" for 77.168.84.58 at 2014-02-17 12:10:01 +0100 Processing by DashboardController#show as HTML Completed 401 Unauthorized in 2ms Started GET "/" for 77.168.84.58 at 2014-02-17 12:10:01 +0100 Processing by DashboardController#show as HTML Completed 401 Unauthorized in 1ms Started GET "/" for 77.168.84.58 at 2014-02-17 12:10:01 +0100 Processing by DashboardController#show as HTML Completed 401 Unauthorized in 1ms Started GET "/" for 77.168.84.58 at 2014-02-17 12:10:01 +0100 Processing by DashboardController#show as HTML Completed 401 Unauthorized in 2ms Started GET "/" for 77.168.84.58 at 2014-02-17 12:10:02 +0100 Processing by DashboardController#show as HTML Completed 401 Unauthorized in 2ms Started GET "/" for 77.168.84.58 at 2014-02-17 12:10:02 +0100 Processing by DashboardController#show as HTML Completed 401 Unauthorized in 2ms 

问题来自您的反向代理定义。 你有一个循环,因为这个问题:

 ProxyPassReverse http://gitlab.martijn.osbournia.com/ 

像这样修改你的configuration:

 <Proxy balancer://unicornservers> BalancerMember http://127.0.0.1:8081 </Proxy> ProxyPass / balancer://unicornservers/ ProxyPassReverse / balancer://unicornservers/ ProxyPreserveHost on