From: Shane Jaroch Date: Thu, 15 Jan 2026 22:16:28 +0000 (-0500) Subject: handle git URLs (but this doesn't work) X-Git-Url: https://git.nutra.tk/v2?a=commitdiff_plain;h=5bf7667c0ccaeb72b0ba2ada6e129be547837932;p=nutratech%2Fvps-root.git handle git URLs (but this doesn't work) --- diff --git a/etc/nginx/conf.d/git-http.conf b/etc/nginx/conf.d/git-http.conf index bd63baf..58bd8c3 100644 --- a/etc/nginx/conf.d/git-http.conf +++ b/etc/nginx/conf.d/git-http.conf @@ -110,13 +110,29 @@ server { return 302 /v3/admin; } - location /v3/ { + location ^~ /v3/ { proxy_pass http://localhost:3000/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } + + # ---------------------------------------------------------------------- + # Clean Git Remotes (Root Level .git) + # ---------------------------------------------------------------------- + # Catches /user/repo.git and /user/repo.git/info/refs + # Place this AFTER v1/v2 regex blocks so it doesn't interfere with them + location ~ \.git(/|$) { + proxy_pass http://localhost:3000; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + + # Recommended for Git Pushes + client_max_body_size 512M; + } } # HTTP to HTTPS redirect