Skip to main content
Setting up Bunny CDN with ExpressionEngine takes only a single line of configuration plus a template change.
1

Create a Pull Zone

Log in to your bunny.net dashboard and create a new Pull Zone with your ExpressionEngine site as the origin URL. For details, see How to create your first Pull Zone.
2

Edit your index.php file

You’ll need SSH or FTP access to your web server. Open the index.php file in your site’s root and find this line:
// $assign_to_config['global_vars'] = array();
Uncomment it and define a global variable for your CDN URL, replacing the hostname with your Pull Zone:
$assign_to_config['global_vars'] = array('cdn_url' => 'https://YOURZONE.b-cdn.net/');
3

Use the variable in your templates

Update your templates to reference the new {cdn_url} variable when linking to static resources. For example:
{cdn_url}uploads/image.jpg
4

Test the integration

Load your site and confirm that the URLs for your static content now include your Pull Zone hostname. Once they do, ExpressionEngine is serving assets through Bunny CDN.
Last modified on June 23, 2026