From 5bf7667c0ccaeb72b0ba2ada6e129be547837932 Mon Sep 17 00:00:00 2001 From: Shane Jaroch Date: Thu, 15 Jan 2026 17:16:28 -0500 Subject: [PATCH] handle git URLs (but this doesn't work) --- etc/nginx/conf.d/git-http.conf | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) 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 -- 2.52.0