- Your origin is behind a firewall that blocks CDN requests
- You need to bypass proxy services like Cloudflare
- You want to connect directly to a specific server IP
Prerequisites
- A pull zone configured in the bunny.net dashboard
- Your origin server’s IP address
- A custom hostname you want to use for serving content
Configuration
1
Update your origin URL to the server IP
Navigate to your pull zone and go to General → Origin.Set the origin URL to point directly to your server’s IP address:
- Select the correct scheme (
HTTPorHTTPS) to prevent redirects - If you have Forward Host Header enabled, disable it for this configuration
At this point, your pull zone will connect to the server directly. However, the server will return the default website configured for that IP. Step 2 configures bunny.net to send the correct hostname to your origin.
2
Add the custom hostname to your pull zone
Go to General → Hostnames and add your custom hostname:
- Enter your domain name in the Add a custom hostname field
- Click Add Hostname
3
Configure DNS
Update your DNS provider to point your custom hostname to the bunny.net pull
zone: - Create a CNAME record pointing to your pull zone hostname (e.g.,
your-zone.b-cdn.net)4
Enable SSL (optional)
After DNS propagation, you can enable SSL for your custom hostname:
- Click Verify & Activate SSL to get a free Let’s Encrypt certificate
- Alternatively, scroll to Linked Hostnames and click Enable to activate SSL later or upload your own certificate
5
Create an Edge Rule to set the Host header
Navigate to Edge Rules and create a new rule to send the correct hostname to your origin:
| Setting | Value |
|---|---|
| Action | Set Request Header |
| Header Name | Host |
| Header Value | Your origin hostname (e.g., example.com) |
| Condition | Request URL |
| Match Type | Match Any |
| Condition Value | * |
6
Purge cache
If you had cached content from a previous configuration, purge the cache to ensure fresh content is fetched from the new origin.
How it works
When a request comes in:- The client connects to your custom hostname (served by bunny.net)
- bunny.net connects directly to your origin server IP
- The Edge Rule sets the
Hostheader so your origin knows which website to serve - Your origin responds with the correct content
Related
- Variable Expansion - Use dynamic values in your Edge Rules
- Rule Ordering - Understand how multiple rules interact