title: Git server over http using nginx in windows
body: <p>I'm trying to setup private git server over http(s) using nginx in windows , but without any success yet. </p>
  
  <p>I want it to be like github but locally and with very simple functionality . For example when you go to <code>localhost/path/to/your/repo.git</code> this site will only display the source code tree list nothing else. you have to do all git commands using git console in your machine.</p>
  
  <p>I saw many posts to do something like that like:</p>
  
  <ul>
  <li><p><a href="https://stackoverflow.com/questions/6414227/how-to-serve-git-through-http-via-nginx-with-user-password">how to serve git through http via nginx with user password</a></p></li>
  <li><p><a href="https://gist.github.com/massar/9399764" rel="nofollow noreferrer">https://gist.github.com/massar/9399764</a></p></li>
  <li><p>...</p></li>
  </ul>
  
  <p>Actually, I need to know that do I really need nginx ? I mean can I make it work with just python server code ?</p>
  
  <p>I really confused what I have to do and what I'm missing, because it's my first time to deal with something like this and don't know nginx very well.</p>
  
  <p>Can anyone help me to get it done ?</p>
  
  <p><strong>NOTE</strong> I don't want to use other tools like gitlab, I want to code it from the beginning  </p>
  
  <hr>
  
  <p><strong>EDIT</strong>  </p>
  
  <p>I read about git-http-backend in <a href="http://git-scm.com/docs/git-http-backend" rel="nofollow noreferrer">git docs</a>. I think now I should configure nginx to work with git-http-backend.exe (because I'm in windows)</p>
  
  <p>here is my nginx conf file:</p>
  
  <p>location / {</p>
  
  <pre><code>    root "C:/Users/One/Desktop/work";
          fastcgi_param SCRIPT_FILENAME   "C:/Program Files (x86)/Git/libexec/git-core/git-http-backend.exe";
          fastcgi_param PATH_INFO         $uri;
          fastcgi_param GIT_EXPORT_ALL "";
          fastcgi_param GIT_PROJECT_ROOT  "C:/Users/One/Desktop/work";  
          include fastcgi_params;
      }
  </code></pre>
  
  <p>I have <code>project.git</code> bare repository in <code>C:/Users/One/Desktop/work</code> , but git always return not found when I try to clone it.</p>
  
  <pre><code>git clone http://localhost/project.git test
  Cloning into 'test'...
  fatal: repository 'http://localhost/project.git/' not found
  </code></pre>
  
  <p>And this is nginx log file </p>
  
  <pre><code>127.0.0.1 - - [24/Jun/2015:14:04:10 +0300] "GET /project.git/info/refs?service=git-upload-pack HTTP/1.1" 404 168 "-" "git/1.9.5.msysgit.0"
  </code></pre>