mirror of
https://hubproxy.babadafafafafa.cn/https://github.com/1Panel-dev/1Panel.git
synced 2026-09-20 08:03:55 +08:00
fix: Resolve the issue of QR code sharing files not being able to download (#12485)
This commit is contained in:
@@ -30,6 +30,16 @@ func Init() {
|
||||
}
|
||||
LocalAgentProxy = &httputil.ReverseProxy{
|
||||
Director: func(req *http.Request) {
|
||||
if req.Header.Get("X-Forwarded-Proto") == "" {
|
||||
if req.TLS != nil {
|
||||
req.Header.Set("X-Forwarded-Proto", "https")
|
||||
} else {
|
||||
req.Header.Set("X-Forwarded-Proto", "http")
|
||||
}
|
||||
}
|
||||
if req.Header.Get("X-Forwarded-Host") == "" && req.Host != "" {
|
||||
req.Header.Set("X-Forwarded-Host", req.Host)
|
||||
}
|
||||
req.URL.Scheme = "http"
|
||||
req.URL.Host = "unix"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user