GeoIP Headers (Request Metadata)
When smoxy forwards requests to your origin servers, it automatically adds a set of HTTP headers containing geolocation and network metadata derived from the client’s IP address. These GeoIP Headers enable dynamic content personalization, language switching, regional compliance, and advanced analytics — all at the edge, before the request even hits your backend.
Overview
These headers are injected into every request by smoxy’s edge infrastructure. They provide rich client context, including the user’s approximate location, network provider, and EU status. This information is resolved in real-time using fast, privacy-conscious IP lookup services.
Included Headers
s-asn
ASN (Autonomous System Number) of the client’s network
s-asorg
Organization name for the ASN (e.g., “Cloudflare, Inc.”)
s-country
ISO 3166-1 alpha-2 country code (DE, US, etc.)
s-city
Approximate city of the client
s-latitude
Approximate latitude
s-longitude
Approximate longitude
s-subdivisions
ISO 3166-2 region/subdivision codes (e.g., DE-BY)
s-iseu
Flag indicating whether the request originates from within the EU (1 or 0)
These values are useful for building location-aware features or routing logic directly in your backend.
Use Cases
Language Redirection
Automatically redirect users to a localized version of your site:
GDPR Compliance
Use s-iseu to trigger EU-only consent dialogs:
IP-Based Routing and Blocking
Allow or restrict access based on ASN or country:
Enhanced Logging / Analytics
Store s-country or s-asorg alongside other request metadata to enrich logs and traffic reports.
Integration Notes
Header names are prefixed with s- to avoid conflicts with standard HTTP headers.
Values are added at the edge by smoxy, so they’re present even before your app processes the request.
These headers are available in all environments — no client-side JS required.
Best Practices
Always treat geolocation as approximate — avoid relying on city-level accuracy for critical decisions.
Provide fallbacks for cases where headers are missing (e.g., during local dev).
Consider logging these values for auditing or debugging location-based behavior.
Last updated
Was this helpful?