Hash

Last updated Apr 16, 2026 Hash steering guides Cloudflare to send requests to endpoints based on a combination of endpoint weights and previous requests from that IP address. Ensures requests from the same IP address will hit the same endpoint, but actual traffic distribution may differ from endpoint weights.

Limitation when using Workers

Hash Steering relies on the x-forwarded-for header to determine the originating IP address of a request. However, when a Cloudflare Worker is used in front of a load balancer, this can affect how Hash Steering functions.

When a request originates from a browser, it lacks an x-forwarded-for header, but if a Worker proxies the request to a load balancer, the header is populated with the Worker's IP instead of the original client IP. Since the Worker's IP — often a Cloudflare public IP — can change between requests, Hash Steering may direct the same client's requests to different endpoints, leading to inconsistent traffic routing.

Workaround

To ensure Hash Steering works correctly when using a Worker in front of a Load Balancer, manually set the x-forwarded-for header in the Worker to the client's original IP address. By manually setting x-forwarded-for to CF-Connecting-IP, Hash Steering will function as expected, ensuring traffic consistency for end users.

Was this helpful?

YesNo

On this page

Hash - 图1Docs

{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/load-balancing/understand-basics/traffic-steering/origin-level-steering/hash-origin-steering/#page","headline":"Hash","description":"Distribute requests using hash-based origin steering.","url":"https://developers.cloudflare.com/load-balancing/understand-basics/traffic-steering/origin-level-steering/hash-origin-steering/","inLanguage":"en","image":"https://developers.cloudflare.com/load-balancing/understand-basics/traffic-steering/origin-level-steering/hash-origin-steering/og.png?v=ccd39c3ee65c23db","dateModified":"2026-04-16","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}


description: Route to the origin with the fewest active requests. title: Least Outstanding Requests image: https://developers.cloudflare.com/load-balancing/understand-basics/traffic-steering/origin-level-steering/least-outstanding-requests-pools/og.png?v=c5448c454271497c


Skip to content

Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/load-balancing/llms.txt
Use this file to discover all available pages before exploring further.