mirror of
https://github.com/KohakuBlueleaf/KohakuHub.git
synced 2026-05-03 19:07:46 -05:00
Update admin portal and minor fixes, fix nginx config for git
This commit is contained in:
@@ -50,7 +50,8 @@ server {
|
||||
# 4. Git HTTP Smart Protocol endpoints
|
||||
# Covers: /{namespace}/{name}.git/info/refs, /{namespace}/{name}.git/git-upload-pack, etc.
|
||||
# This enables native Git clone/push operations
|
||||
location ~ ^/([^/]+)/([^/]+)\.git/(info/refs|git-upload-pack|git-receive-pack|HEAD) {
|
||||
# Pattern matches: /anything/anything.git/endpoint (hyphens, numbers, letters all OK)
|
||||
location ~ \.git/(info/refs|git-upload-pack|git-receive-pack|HEAD) {
|
||||
proxy_pass http://hub-api:48888;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
@@ -67,6 +68,16 @@ server {
|
||||
|
||||
# Git protocol specific headers
|
||||
proxy_set_header Content-Type $content_type;
|
||||
|
||||
# Cloudflare compatibility - prevent caching and compression
|
||||
# Add these headers to tell Cloudflare not to cache Git protocol responses
|
||||
add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0" always;
|
||||
add_header X-Content-Type-Options "nosniff" always;
|
||||
add_header X-Accel-Buffering "no" always;
|
||||
|
||||
# Ensure proper content type is preserved
|
||||
proxy_hide_header X-Content-Type-Options;
|
||||
proxy_hide_header Cache-Control;
|
||||
}
|
||||
|
||||
# 5. Git LFS endpoints
|
||||
|
||||
Reference in New Issue
Block a user