The origin server is where your actual content resides. Sundun fetches content from your origin and caches it at edge locations worldwide. This guide covers origin server configuration options.
User → Sundun Edge (cache) → Origin Server (your server) ↓ Cache HIT: Serve from edge Cache MISS: Fetch from origin
Your origin server can be:
| Setting | Description | Example |
|---|---|---|
| Origin Address | IP address or hostname | origin.example.com or 203.0.113.50 |
| Origin Port | HTTP/HTTPS port | 80, 443, or custom |
| Origin Protocol | HTTP or HTTPS | HTTPS recommended |
| Weight | Load balancing weight | 1-100 |
Use a domain name for your origin:
Origin: origin.example.com
Advantages:
DNS Requirements:
Use a direct IP address:
Origin: 203.0.113.50
Advantages:
Considerations:
Edge Server ──HTTPS──▶ Origin Server
Configure HTTPS origin:
Edge Server ──HTTP──▶ Origin Server
Warning: HTTP origins transmit data unencrypted between edge and origin. Only use for non-sensitive content or when origin is on a private network.
The Host header tells your origin which site is being requested. Configure this when:
| Option | Behavior |
|---|---|
| Accelerated Domain | Sends the user's requested domain |
| Origin Domain | Sends the origin server hostname |
| Custom | Sends a custom hostname you specify |
Example:
User requests: www.example.com Origin server: origin.example.com # Option 1: Accelerated Domain Host: www.example.com # Option 2: Origin Domain Host: origin.example.com # Option 3: Custom Host: backend.example.com
Configure timeout values for origin connections:
| Timeout | Default | Range | Description |
|---|---|---|---|
| Connect | 5s | 1-60s | Time to establish TCP connection |
| Read | 30s | 1-300s | Time to receive response |
| Send | 30s | 1-300s | Time to send request |
{ "origin": { "connect_timeout": 5, "read_timeout": 60, "send_timeout": 30 } }
Tip: Increase read timeout for APIs that perform heavy processing.
Configure multiple origin servers for high availability:
Distribute requests evenly across origins:
Origin 1: 203.0.113.50 (weight: 50) Origin 2: 203.0.113.51 (weight: 50)
Send more traffic to faster servers:
Origin 1: 203.0.113.50 (weight: 70) ← 70% of traffic Origin 2: 203.0.113.51 (weight: 30) ← 30% of traffic
Use backup origin when primary fails:
Origin 1: 203.0.113.50 (primary) Origin 2: 203.0.113.51 (backup)
Monitor origin server health to route traffic away from unhealthy servers:
| Setting | Description | Default |
|---|---|---|
| Path | URL path to check | /health |
| Interval | Check frequency | 30 seconds |
| Timeout | Response timeout | 5 seconds |
| Threshold | Failures before unhealthy | 3 |
Your origin should return:
HTTP/1.1 200 OK Content-Type: text/plain OK
Any 2xx response marks the origin as healthy.
Origin Shield adds an additional caching layer between edge servers and your origin, reducing origin load:
User → Edge PoP → Origin Shield → Origin Server
Recommended Shield Locations:
| Origin Location | Shield Location |
|---|---|
| US East | Washington DC |
| US West | Los Angeles |
| Europe | Frankfurt |
| Asia Pacific | Singapore |
Configure how Sundun handles origin redirects:
| Option | Behavior |
|---|---|
| Disabled | Return redirect to user |
| Enabled | Follow redirect at edge |
Add custom headers to origin requests:
X-Forwarded-For: Client IP address X-Real-IP: Client IP address X-Forwarded-Proto: https X-Sundun-Request-ID: Unique request identifier
Forward query parameters to origin:
# Enabled (default) User: /page?id=123 Origin: /page?id=123 # Disabled User: /page?id=123 Origin: /page
Origin Address: bucket-name.s3.amazonaws.com Origin Protocol: HTTPS Host Header: bucket-name.s3.amazonaws.com
S3 Bucket Policy:
{ "Version": "2012-10-17", "Statement": [{ "Effect": "Allow", "Principal": "*", "Action": "s3:GetObject", "Resource": "arn:aws:s3:::bucket-name/*", "Condition": { "IpAddress": { "aws:SourceIp": ["Sundun IP ranges"] } } }] }
Origin Address: storage.googleapis.com Origin Protocol: HTTPS Path Prefix: /bucket-name
Origin server is unreachable:
Origin server is too slow:
Certificate issues with HTTPS origin:
Configure origin via API:
# Get origin configuration curl -X GET https://api.Sundun.com/v1/domains/example.com/origin \ -H "Authorization: Bearer YOUR_API_KEY" # Update origin curl -X PUT https://api.Sundun.com/v1/domains/example.com/origin \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "origins": [{ "address": "origin.example.com", "port": 443, "protocol": "https", "weight": 100 }], "health_check": { "path": "/health", "interval": 30 } }'
Need help with origin configuration? Contact support@Sundun.com