For to be to make you smarter. For to be to get you dead.

gitweb and nginx 2012-01-26

Update: I have now added git-http-backend into this mix to allow cloning of these repositories over https. This complicated things quite a bit more than my original posting.

I have recently undergone the enterprise of switching all of my web servers from apache2 to nginx. I don't have anything in particular against apache2, but it uses much more memory and I don't really need most of its features.

This transition went smoothly for the most part, with the exception of converting my web-accessible git interface using gitweb. I found a few guides on the topic but nothing that worked quite the way I wanted it to.

First of all, I have made some alterations to the default gitweb.conf:

I cannot stand the way gitweb does uris by default, but the "nicer uris" was where most of the headache came from when I was moving to nginx. Here is the nginx configuration I settled on:

Hopefully this comes in handy to someone else trying to do such a setup.