Integration Guides
Learn how to integrate redirect lookups into your server infrastructure using our Edge Query API.
Integration Guides
These guides show you how to integrate the Redirections Edge Query API into your existing server infrastructure. Each guide provides step-by-step instructions from zero to working redirect lookups in approximately 30 minutes.
Available Platforms
Choose your platform to get started:
Web Servers
Apache
Integrate redirects using mod_rewrite and external lookup scripts. Supports both real-time API calls and periodic sync patterns.
Nginx
Integrate redirects using lua-nginx-module and lua-resty-http. Works with standard Nginx and OpenResty distributions.
HAProxy
Integrate redirects using Lua HTTP calls and map files. Enterprise-grade load balancing with dynamic redirect rules.
Varnish
Integrate redirects using VCL and inline-c or VMOD. High-performance caching proxy with redirect lookup capabilities.
Application Frameworks
Next.js
Integrate redirects using middleware for App Router and Pages Router. Supports both runtime lookups and build-time static generation.
Node.js
Integrate redirects into Express and Fastify applications. Works with any Node.js HTTP framework using standard middleware patterns.
Integration Patterns
Each platform guide demonstrates two integration patterns. Choose the pattern that best fits your traffic volume and freshness requirements.
Pattern 1: Real-Time API Lookup
Best for: High freshness requirements, moderate traffic volumes (up to ~1000 req/min).
Every incoming request triggers a lookup to the Edge Query API. This provides the freshest redirect data with no sync delays, but adds API call latency to each request path.
Characteristics:
- Freshness: Immediate (redirect changes apply within seconds)
- Latency: Adds ~20-50ms per request (global edge network)
- Complexity: Simple (no sync infrastructure needed)
- Quota impact: Consumes API quota per request
When to use:
- You need redirect changes to apply immediately
- You have moderate traffic (<1000 requests/min on free tier, <10K on Pro)
- Your application can tolerate 20-50ms additional latency
- You prefer operational simplicity over maximum performance
Pattern 2: Periodic Sync + Local Config
Best for: High traffic volumes, performance-critical applications, cost optimization.
A background job periodically fetches all redirect rules from the Export API and generates local configuration files. Your server loads these files directly, providing zero-latency lookups at the cost of eventual consistency.
Characteristics:
- Freshness: Eventual (5-60 minute sync intervals typical)
- Latency: Zero (local config file lookups)
- Complexity: Moderate (requires sync script and cron job)
- Quota impact: Minimal (only export API calls)
When to use:
- You have high traffic volumes (thousands of requests per second)
- Sub-millisecond redirect lookup latency is required
- Redirect changes can tolerate 5-60 minute propagation delay
- You want to minimize API quota consumption
Choosing Your Pattern
| Factor | Real-Time Lookup | Periodic Sync |
|---|---|---|
| Traffic volume | <1K req/min | Any volume |
| Freshness need | Seconds | Minutes |
| Latency tolerance | 20-50ms OK | Must be <1ms |
| Operational complexity | Minimal | Moderate |
| API quota impact | High | Low |
Most applications start with Real-Time Lookup for simplicity, then migrate to Periodic Sync as traffic grows or when performance optimization becomes critical.
Prerequisites
Before following any platform guide, you'll need:
- An API Key - Generate one in your project's Settings > API Keys section
- Your Project ID - Found in the project URL or dashboard
- At least one redirect rule - Create test rules to verify the integration
All guides use these placeholder values:
YOUR_API_KEY- Replace with your actual API keyYOUR_PROJECT_ID- Replace with your actual project ID
Troubleshooting
If you encounter issues during integration, see the Troubleshooting Guide for common problems and solutions across all platforms.