Hi all,

We've configured a "Git server" to store all our work of some project. We 
decided to use HTTP with apache2 (2.2.21) and nginx as reverse proxy to 
We wanted for all repositories to use URL like 


By design, as I get it, git receives in URI /git/Repo-name. Tried to figure 
out how to do that natively but no luck, so created a RewriteRule to 
redirect all requests for

git.domain.com/Repo-name ->>>  git.domain.com/git/Repo-name

In general it works, but we encountered an error on "git push" command with 
GUI and bash-like git clients:

Push failed 
fatal: The remote end hung up unexpectedly fatal: The remote end hung up 
unexpectedly error: RPC failed; result=65, HTTP code = 302 

I checked google, everybody speaks about size of push, but in our case it's 
about several Kb-s
As workaround we forced the guy with a problem to use 

Here's our config of apache:

<VirtualHost *:8080>

ServerName git.domain.com
ServerAlias gitdyn.domain.com
ServerAdmin sysad...@domain.com
CustomLog logs/access_git_log combined
ErrorLog  logs/error_git_log
DocumentRoot /home/git

SetEnv GIT_PROJECT_ROOT /home/git/
ScriptAlias /git /usr/libexec/git-core/git-http-backend

RewriteEngine On
RewriteCond %{REQUEST_URI} !^/git
RewriteRule ^/(.*)$ http://git.domain.com/git/$1

<Location /git/Repo-name>
        AuthBasicProvider ldap
        AuthType Basic
        AuthzLDAPAuthoritative off
        AuthName "Git server"
        AuthLDAPBindDN "CN=ldapauthuser,CN=Users,DC=domain,DC=com"
        AuthLDAPBindPassword ldapauthpassword
        require ldap-group CN=Some GIT Group,CN=Users,DC=domain,DC=com


And nginx proxy:

        server {
        listen       *:80;
        server_name  git.domain.com;

        access_log   /var/log/nginx/access_gitweb_log  combinedwww;
        error_log    /var/log/nginx/error_gitweb_error_log debug;

        proxy_set_header   X-Forwarded-For      $proxy_add_x_forwarded_for;
        proxy_set_header   X-Forwarded-Host     $host;
        proxy_set_header   Host                 $host;
        proxy_set_header   X-Forwarded-Server   $host;
        proxy_redirect     off;

       client_max_body_size 0M;
       client_body_buffer_size    128k;

       proxy_connect_timeout      90;
       proxy_send_timeout         90;
       proxy_read_timeout          90;

       proxy_buffer_size          4k;
       proxy_buffers              4 32k;
       proxy_busy_buffers_size    64k;
       proxy_temp_file_write_size 64k;

       location / {
               allow some.other.external.IP-s;
               proxy_pass http://gitdyn.domain.com:8080/;

You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to