-
-
Save srquinn21/6771620 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 443; | |
server_name git.eatabrick.org; | |
error_log /var/log/nginx/git.error.log; | |
access_log /var/log/nginx/git.access.log; | |
# ssl because cox sucks | |
ssl on; | |
ssl_certificate /etc/nginx/ssl/git.eatabrick.org; | |
ssl_certificate_key /etc/nginx/ssl/server.key; | |
root /usr/share/gitweb; | |
# static repo files for cloning over https | |
location ~ ^.*\.git/objects/([0-9a-f]+/[0-9a-f]+|pack/pack-[0-9a-f]+.(pack|idx))$ { | |
root /home/git/repositories/; | |
} | |
# requests that need to go to git-http-backend | |
location ~ ^.*\.git/(HEAD|info/refs|objects/info/.*|git-(upload|receive)-pack)$ { | |
root /home/git/repositories; | |
fastcgi_pass unix:/var/run/fcgiwrap.socket; | |
fastcgi_param SCRIPT_FILENAME /usr/lib/git-core/git-http-backend; | |
fastcgi_param PATH_INFO $uri; | |
fastcgi_param GIT_PROJECT_ROOT /home/git/repositories; | |
include fastcgi_params; | |
} | |
# send anything else to gitweb if it's not a real file | |
try_files $uri @gitweb; | |
location @gitweb { | |
fastcgi_pass unix:/var/run/fcgiwrap.socket; | |
fastcgi_param SCRIPT_FILENAME /usr/share/gitweb/gitweb.cgi; | |
fastcgi_param PATH_INFO $uri; | |
fastcgi_param GITWEB_CONFIG /etc/gitweb.conf; | |
include fastcgi_params; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment