Skip to content

Instantly share code, notes, and snippets.

@kierdwyn
kierdwyn / server-git.conf
Last active March 17, 2024 22:49 — forked from massar/server-git.conf
Nginx git smart http protocol (git-http-backend) configuration with basic authentication. Need the support of fcgiwrap.
# Example nginx + git HTTP Smart mode (git-http-backend) + HTTP Authentication + HTTPS redirect
# Forked from [email protected] - http://jeroen.massar.ch
# Preparation: you need to install and configure fcgiwrap and set it to listen at fcgiwrap.socket.
# An example tutorial: https://www.howtoforge.com/serving-cgi-scripts-with-nginx-on-centos-6.0-p2
# A useful hint: add -f as a parameter to fcgiwrap to redirect the cgi errors to your nginx error log.
server {
listen 80;
server_name git.example.com;