Add DisableAutoFallback option for proxy endpoints #896

- Added new behavior in upstream random selector (ignore offline check for upstream if there is only one upstream for this proxy rule)
- Added config file only DisableAutoFallback option
This commit is contained in:
Toby Chui
2025-11-18 22:51:55 +08:00
parent d049108f74
commit db407d497f
8 changed files with 77 additions and 33 deletions

View File

@@ -152,7 +152,7 @@ func (router *Router) StartProxyService() error {
}
}
selectedUpstream, err := router.loadBalancer.GetRequestUpstreamTarget(w, r, sep.ActiveOrigins, sep.UseStickySession)
selectedUpstream, err := router.loadBalancer.GetRequestUpstreamTarget(w, r, sep.ActiveOrigins, sep.UseStickySession, sep.DisableAutoFallback)
if err != nil {
http.ServeFile(w, r, "./web/hosterror.html")
router.Option.Logger.PrintAndLog("dprouter", "failed to get upstream for hostname", err)