@@ -398,6 +398,47 @@ path_routing:
398398 registry : maven
399399` ` `
400400
401+ ### Load Balancing Across Clusters (` allowed_domain` + `use_incoming_domain`)
402+
403+ A path-routing deployment normally answers only to `domain`, and a request whose
404+ ` Host` doesn't match falls through to the default server and 404s. That becomes a
405+ problem when you run the firewall in several clusters behind a load balancer : the
406+ LB forwards requests to a pod under a per-cluster hostname, which is *not* the
407+ stable LB hostname. Two options let you handle this :
408+
409+ ` ` ` yaml
410+ path_routing:
411+ enabled: true
412+ domain: socket-firewall-registry.apps.company.com # stable LB hostname
413+
414+ # (A) allowed_domain: additional hostnames this server answers to, beyond
415+ # ` domain`. Without it, a Host that doesn't match `domain` 404s. Entries may be
416+ # exact names, nginx wildcards (*.cluster.company.com), or a regex (~^.+$) for a
417+ # true catch-all.
418+ allowed_domain :
419+ - socket-firewall-registry.gateway.unified-30.internal.api.company.com
420+ - " *.unified-clusters.internal.api.company.com"
421+
422+ # (B) use_incoming_domain: which host package URLs are rewritten to.
423+ # false (default) -> rewrite using `domain` (the stable LB hostname), so
424+ # follow-up downloads route back through the load balancer and spread across
425+ # clusters even though the request arrived on a per-cluster Host.
426+ # true -> rewrite using the incoming Host header.
427+ use_incoming_domain : false
428+
429+ routes :
430+ - path : /npm
431+ upstream : https://registry.npmjs.org
432+ registry : npm
433+ ` ` `
434+
435+ ` allowed_domain` defaults to empty and `use_incoming_domain` to `false`. For a
436+ single-domain deployment the incoming `Host` already equals `domain`, so the
437+ defaults reproduce today's behavior. For the load-balancer case above,
438+ `allowed_domain` stops the 404s and the default `use_incoming_domain : false` makes
439+ the firewall advertise the LB hostname (`domain`) in rewritten URLs so downloads
440+ balance across clusters rather than pinning to the cluster that served the metadata.
441+
401442# ## Enterprise: Auto-Discovery from Artifactory/Nexus
402443
403444Automatically sync repository routes :
0 commit comments