Your rights agreement says a live match can play in five countries, but a request arrives from a sixth. If that request reaches the origin before you reject it—or if you protect the player page but leave the manifest public—you may be paying to deliver video you are not allowed to distribute. Geo blocking solves the first part of that problem by making location an access-control input at the edge.
What is geo blocking? Geo blocking is a policy that allows or denies access to content according to the viewer’s estimated location, usually derived from the public IP address. For video, the strongest practical design checks the request before the CDN serves the manifest, then reinforces that decision with short-lived authorization and protected origin access.
That definition sounds simple. Production behavior is not. A streaming session may request a master playlist, a media playlist, hundreds of segments, encryption keys, subtitles, thumbnails, and a DRM license from different hostnames. A rule attached to only one of those paths can leave a useful bypass.
This guide explains the request flow, where to enforce it for HLS and DASH, what GeoIP can and cannot prove, and how to roll out a geo-restriction without breaking legitimate playback.
How geo blocking works at the CDN edge
At a high level, the edge receives a viewer request, identifies the viewer’s source IP, maps that IP to a country or region, evaluates an allowlist or denylist, and either serves the resource or returns a denial. The origin does not need to perform that lookup for every request when the CDN can make the decision closer to the viewer.
Amazon CloudFront’s geographic-restriction documentation describes the common country-level model: an allowlist grants access only in named countries, while a denylist blocks named countries and permits the rest. In its implementation, a rejected request receives HTTP 403 Forbidden at the edge.
The important word is estimated. A CDN does not infer a person’s legal residence from an IP address. It looks up the network address presented by the connection and returns the location associated with that address. A mobile carrier gateway, corporate network, proxy, or VPN may be somewhere other than the viewer.
The edge decision in six steps
For each protected request, the delivery path is usually:
- The player resolves the delivery hostname and connects to a nearby CDN edge.
- The edge identifies the client IP from the trusted connection context.
- A GeoIP database maps the address to a country code and, when available, a subdivision or city with an uncertainty range.
- The edge selects the policy for the requested asset, title, event, or distribution.
- The policy evaluates geography alongside any authorization token, time window, and account entitlement.
- The edge returns the object from cache, fetches it from the origin, or denies the request without forwarding it.
The lookup should happen in trusted infrastructure. Do not let a viewer choose their own country by sending a query parameter or an unverified header. If your application sits behind multiple proxies, define which hop is allowed to supply the client address; accepting an arbitrary X-Forwarded-For value creates a spoofing path. AWS makes the same distinction in its guidance: the correct address source depends on whether the server is directly connected or behind a load balancer.
Why edge enforcement is the useful default
An application server can perform the same GeoIP lookup, but origin-only enforcement gives rejected traffic a longer and more expensive path. The request can traverse the CDN, consume origin connections, and reach the application before it is stopped. That is unnecessary work during ordinary traffic and a larger exposure during a spike.
Edge enforcement also gives one policy point to cached and uncached objects. A decision made before cache lookup prevents a cached copy from becoming a bypass. The cache key still matters, however: if an authorization response varies by policy or entitlement, make sure a permitted response cannot be reused for a requester with different access.
Country-level blocking is the common baseline because it fits the precision of IP geolocation better than a city-radius promise. MaxMind estimates 99.8% country-level accuracy for its GeoIP products, while explicitly warning that accuracy varies by country, network type, IP version, and ISP practice. It also says IP geolocation is not precise enough to identify a household, person, or street address.
Where geo blocking must apply in a video stack
A web page is not the video. Blocking a catalogue page or hiding a play button may improve the user experience, but it does not secure a directly requested manifest or segment URL. Map the entire playback graph before you decide that a title is geo restricted.
The HTTP Live Streaming specification defines playlists that reference media segments and, depending on the stream, encryption keys and alternate renditions. DASH uses a different manifest format but creates the same operational problem: playback is a sequence of related HTTP requests, not one download.
| Request surface | Why it matters | Minimum policy |
|---|---|---|
| Playback or entitlement API | Decides whether the account may start a session | Filter the catalogue and refuse session creation outside the territory |
| Master manifest | Reveals available variants and points to more playlists | Require a valid territorial decision and authorization |
| Media manifests | Continuously expose segment locations for live streams | Apply the same policy as the master manifest |
| Video and audio segments | Carry the actual media | Prevent direct, unsigned, or origin access |
| Encryption key or DRM license | Enables decryption of protected media | Recheck entitlement and territory independently when risk warrants it |
| Subtitles, thumbnails, downloads | May themselves be licensed assets | Inherit the title policy unless rights explicitly differ |
| Origin hostname | Can bypass the edge if public | Restrict access to the CDN or another trusted delivery path |
Protect both the manifest and the segments
If you protect only the master manifest, a viewer who obtains a segment URL may still fetch media. If you protect every segment with an expensive application lookup, you can add latency and load to a request pattern that repeats every few seconds. A common compromise is to authorize the session once, issue a short-lived signed cookie or token that covers the playlist’s resource path, and validate it cheaply at the edge on subsequent requests.
This is one reason a cookie can be more convenient than signing every HLS object separately. AWS recommends signed cookies when access must cover multiple restricted files, including all files for an HLS video. The exact mechanism varies by provider, but the design goal is consistent: bind the set of playback requests to a limited authorization window.
Live streams need special care around expiry. If a token lasts less time than the session, the player may fail on a playlist refresh or segment request. If it lasts for hours after playback ends, sharing becomes easier. Choose a short validity period, refresh it through an authenticated session before it expires, and test the refresh while the player is buffering, seeking, and switching renditions.
Close the origin bypass
Geo rules on a CDN hostname do nothing if the same objects are publicly reachable at origin.example.com or through a storage-provider URL. A viewer can simply skip the edge. Restrict the origin so that only the CDN’s authenticated origin requests can retrieve protected media.
AWS’s private-content guidance recommends preventing direct S3 access when CloudFront is the intended protected path. The vendor-specific control may be origin access control, mutual authentication, signed origin requests, or a tightly scoped network policy. The principle is to make the governed path the only usable path.
Keep policy consistent across hostnames
Teams often put manifests on one hostname, segments on another, and licenses on a third. That architecture is valid, but every hostname needs a documented role in the same rights policy. Decide whether the country decision is recomputed, carried in a signed claim, or checked by a centralized entitlement service.
Avoid blindly trusting a country header received over the public internet. An edge-added country code is useful only when the application can verify that the request came through that edge and that untrusted clients cannot set or preserve the same header.
Allowlist or denylist: choose from the rights model
An allowlist starts closed: only named territories can play the content. A denylist starts open: every territory can play unless it is named as blocked. Neither is universally better; the rights contract should decide.
| Situation | Safer starting policy | Reason |
|---|---|---|
| A sports event licensed in a short list of markets | Allowlist | An omitted country remains blocked |
| A film with territory-by-territory distribution rights | Allowlist | Availability follows explicit grants |
| A globally available public stream with a few legal exclusions | Denylist | The default matches broad availability |
| Internal video intended only for operating countries | Allowlist plus identity | Geography alone does not authenticate employees |
| A marketing site localizing content | Usually neither as a hard block | Location can personalize without denying access |
For licensed video, fail-closed behavior is often easier to defend: if the GeoIP lookup produces no usable country, the request is denied or sent to a recovery flow. For a free marketing video, failing open may be acceptable. Record that decision per content class rather than burying one global default in edge code.
Policy granularity matters too. A distribution-wide country list is easy to operate, but it cannot represent two titles with different rights. CloudFront documents this limitation for its native geo restrictions: the rule applies to the whole distribution, and finer or content-specific control requires another design. An OTT catalogue normally needs title-level or event-level policy data, even if the edge remains the enforcement point.
Treat rights data as versioned configuration
Territories change when a contract starts, expires, or is amended. Store policy with a stable content identifier, an effective time window, allowed or blocked ISO country codes, an owner, and an audit trail. Validate country codes during deployment, and reject a policy that contains both contradictory allow and deny semantics.
A useful record might include:
{
"content_id": "event-2026-final",
"mode": "allow",
"countries": ["AE", "IN", "SG"],
"starts_at": "2026-08-18T12:00:00Z",
"ends_at": "2026-08-18T16:30:00Z",
"unknown_location": "deny"
}
This example is a policy shape, not a legal recommendation. The actual territory list and time window must come from the rights owner or counsel. Automate activation and expiry so a midnight handoff does not depend on an operator editing production rules under pressure.
Geo-blocking architecture for HLS and DASH
The most reliable implementation separates policy authoring from request enforcement. A rights or operations system owns the allowed territories. A session service turns the viewer’s identity, title, time, and location into a short-lived decision. The CDN edge enforces that decision on the high-volume media path.

A practical layered request flow
- Catalogue stage: The application can hide unavailable titles or explain that an event is not offered in the viewer’s region. This is a user-experience layer, not the security boundary.
- Session stage: When the viewer presses play, the playback API checks authentication, subscription or purchase entitlement, title rights, the current time window, and the trusted GeoIP result.
- Token stage: If allowed, the service issues a short-lived signed token or cookie scoped to the correct media paths. Do not encode an unlimited, long-lived grant.
- Edge stage: The CDN validates the token and the geographic policy before returning manifests and segments. Denied requests stop before cache or origin delivery.
- Origin stage: The storage or packager accepts requests only from the trusted CDN path, preventing direct retrieval.
- License stage: For DRM content, the license service applies its own entitlement rules. This prevents a copied manifest alone from yielding a usable decryption key.
Signed access and geo blocking answer different questions. Geography asks, “Is this request in a permitted territory?” A signed token asks, “Did a trusted service authorize this resource and has that authorization expired?” CloudFront’s signed-URL documentation shows how a policy can limit expiry and optionally an IP range; it also validates the signature before serving the file.
ZeroBuffer fits the delivery layer of this design when a media team needs global CDN delivery, origin shielding, and modern edge protocols for HLS or DASH. Its OTT and video CDN overview describes media-oriented origin shielding alongside QUIC and TLS 1.3; the rights service and authorization policy should still remain explicit parts of the platform architecture.
Decide how geography and tokens interact
There are two common patterns:
- Re-evaluate geography on every request. This reacts quickly when a viewer’s IP changes, but it can interrupt legitimate mobile sessions and makes GeoIP data part of every segment decision.
- Bind geography at session creation. The session token contains a signed country claim or policy result for a short period. This reduces repeated policy work, but the system must decide what happens when the network changes before refresh.
A hybrid is usually easier to operate: perform a full decision at session creation, use a short-lived token on the media path, and re-evaluate at refresh or on suspicious change. For strict rights, the DRM license service can provide another independent checkpoint.
Do not bind a token to an exact IP without testing mobile and household network changes. A viewer can move from Wi-Fi to cellular, traverse carrier-grade NAT, or receive a new address while remaining in the same country. Country binding is less brittle, while exact-IP binding may suit a short download or a higher-risk session.
Design a useful denial response
A bare 403 is correct at the protocol level but weak for viewers and support teams. Return a stable machine-readable reason from the playback API, such as territory_not_available, and let the application show an accurate regional-availability message. Do not reveal confidential contract terms or a full allowlist.
Keep media-path denials cache-safe. If the CDN caches an error response, set a deliberate short TTL or exclude user-specific denials from shared caching. Otherwise a temporary policy or database problem can continue blocking playback after the underlying issue is fixed.
Limits: VPNs, proxies, mobile networks, and bad data
Geo blocking is a rights-enforcement control, not proof of a person’s physical presence. A VPN can present an exit IP inside an allowed territory. A corporate proxy can make many employees appear in the headquarters country. Mobile carriers can route traffic through gateways that are far from the handset.
MaxMind’s accuracy guidance specifically notes that a database may locate a VPN server but not the end user behind it. It also recommends falling back to less-specific data when granular information is unavailable. That supports a practical rule: use country-level decisions for country-level rights, and do not treat a city coordinate as precise evidence.
Choose a proportional response to anonymizers
VPN or proxy intelligence can add a signal, but blocking every hosting-provider address can create false positives. Corporate VPNs, privacy relays, and accessibility tools may be legitimate. Define the response according to the content risk:
- allow low-risk free content;
- request re-authentication or another verification step;
- deny premium live content when the rights contract requires active circumvention controls;
- send uncertain cases to a clear support path;
- log the signal and measure impact before turning it into a hard rule.
Avoid publishing detailed detection thresholds or provider lists. Those values change quickly and can make circumvention easier. What matters operationally is the decision hierarchy, the exception process, and the evidence retained for review.
Account for travel and portability
Location and account home country may legitimately differ. A subscriber may travel, a family may move, or a rights regime may require temporary portability. In the EU, Regulation (EU) 2017/1128 establishes cross-border portability rules for qualifying paid online content services when subscribers are temporarily present in another member state.
That does not mean every service should copy one universal travel rule. Product and legal teams need to translate the applicable contract and law into an explicit policy: whether home territory, current location, verified residence, or a temporary-travel window controls access. The engineering system should implement that decision and retain an audit trail, not improvise it.
Test geo blocking before enforcing it
Geo restrictions fail in ways that a normal functional test misses. A developer in an allowed office can see perfect playback while a mobile viewer in the same country is misclassified. A manifest may be blocked while an old segment URL remains public. A denial may work on IPv4 and fail on IPv6.
Build a test matrix before rollout:
- Territories: Test at least one allowed country, one blocked country, and an unknown-location response.
- Address families: Exercise both IPv4 and IPv6 where the service supports them.
- Network types: Include residential broadband, mobile, corporate VPN, and a known proxy or hosting network.
- Playback resources: Request the master manifest, media manifests, segments, keys or licenses, subtitles, thumbnails, and downloads directly.
- Origin bypass: Try the storage and origin hostnames without the CDN.
- Token lifecycle: Test valid, expired, malformed, replayed, and refreshed authorization.
- Player behavior: Test startup, seek, rendition switch, long playback, live-edge catch-up, and network handoff.
- Policy timing: Verify scheduled start, expiry, daylight-independent UTC handling, and rollback.
Use controlled test nodes or approved synthetic probes rather than assuming a consumer VPN represents every viewer in a country. Confirm the egress IP and compare multiple GeoIP sources when investigating a disagreement.
Roll out in observe, explain, enforce stages
Start with a shadow decision that logs what would be blocked without denying playback. Compare that decision with current audience data, support history, and expected rights. Then show regional availability in the catalogue and playback API before enabling hard edge denial.
Canary enforcement on a low-risk title or a small traffic slice. Keep a versioned rollback that restores the previous policy without disabling unrelated access controls. During a live event, a one-command policy rollback is safer than editing country lists manually.
Monitor decisions, not just status codes
A rising 403 rate tells you something changed, but not whether the system is working. Capture structured fields such as policy ID and version, content ID, country code, decision, reason, network type or anonymizer category when permitted, edge location, IP version, token result, and timestamp.
Do not put full IP addresses or sensitive account data into broad analytics by default. Define retention and access around the purpose of rights enforcement. Aggregate dashboards should answer:
- What percentage of playback attempts is denied by territory?
- Did denial rates change after a GeoIP database or policy update?
- Which allowed countries generate the most
unknown_locationdecisions? - Are viewers reaching the origin after an edge denial?
- Did token expiry or country policy cause the failure?
CloudFront notes that its standard logs show a 403 but do not, by themselves, distinguish a geographic denial from other authorization failures. That is a good reason to create explicit reason codes in the session layer and correlate them with edge logs.
Common geo-blocking mistakes
Blocking only the website
Hiding a page does not protect a media URL. Enforce the rule on the playback API and delivery path, then use the application layer to explain it.
Leaving the origin public
If the storage URL still works, the CDN rule is optional from an attacker’s perspective. Restrict origin access and test it from outside trusted infrastructure.
Using one global rule for title-specific rights
A distribution-wide list is simple but cannot express different contracts. Attach policy to a content or event identifier and make its effective period explicit.
Treating GeoIP as identity
An IP country is not a user account, residence document, or GPS proof. Combine geography with authentication and entitlement when the content is not public.
Blocking a manifest but not its dependencies
Segments, subtitles, keys, licenses, and downloads can each become a bypass. Inventory every hostname and object class used during playback.
Caching the wrong decision
Shared caches can leak an allowed response across authorization contexts or preserve a denial longer than intended. Validate cache keys, response headers, and error TTLs.
Updating policy without a rollback
Country lists and rights windows are production configuration. Version, review, schedule, canary, and roll them back like code.
Frequently asked questions
What is geo blocking in video streaming?
Geo blocking in video streaming allows or denies playback according to the viewer’s estimated geographic location, most often mapped from the public IP address. The decision should be enforced on the media delivery path, not only on the website or player interface.
How does a CDN know a viewer’s location?
The CDN maps the source IP address seen on the connection to a GeoIP database and receives an estimated country or region. This method is generally more reliable at country level than at city level and can be affected by VPNs, proxies, mobile gateways, and database errors.
Should video geo blocking use an allowlist or a denylist?
Use an allowlist when playback rights exist only in explicitly named territories; an omitted country then remains blocked. Use a denylist when content is broadly available except in a small, defined set of territories. The rights agreement, not convenience, should choose the default.
Can a VPN bypass geo blocking?
Yes. Basic IP-based geo blocking sees the VPN exit server’s location rather than the viewer behind it. Proxy intelligence, short-lived authorization, account checks, and DRM can raise the barrier, but no single IP rule proves physical presence.
Is geo blocking the same as DRM?
No. Geo blocking decides whether a request from a location may access content, while DRM controls whether an authorized device can obtain and use the keys needed to decrypt protected media. Premium services often use both because they address different failure paths.
Where should geo blocking be enforced for HLS?
Enforce it at session creation and on the CDN paths that serve the master playlist, media playlists, and segments. Protect key or license requests as appropriate, and prevent direct access to the origin so viewers cannot bypass the edge.
What should happen when a viewer’s location is unknown?
Choose a documented policy by content class. Rights-restricted premium video often fails closed or requests another verification step, while low-risk public content may fail open. Monitor unknown-location rates so a data problem does not silently become a broad outage.
Make the territorial rule part of the delivery design
Geo blocking works when the policy, token, cache, player, and origin agree on the same answer. Start with the rights model, enforce the result before media delivery, close direct-origin paths, and design for the uncertainty of IP location rather than pretending it is exact.
Before enabling a hard block, trace one complete HLS or DASH session and test every request it makes from allowed, denied, and unknown locations. If the rule survives that exercise—with clear reason codes, a measured false-positive path, and a fast rollback—you have an access-control system rather than a country list attached to a dashboard.
The rights model and the entitlement service should stay yours. The delivery layer underneath them still has to be fast and cacheable everywhere the content is allowed, and that is the half ZeroBuffer handles: global delivery across 100+ edge locations with origin shielding for HLS and DASH, HTTP3 over QUIC and TLS 1.3, instant cache purge for policy changes that must take effect now, and flat pricing from $0.0049/GB. See the OTT delivery stack.
