XF 2.1 Setting up a CDN for 2.1

Movie Prop Sites

Active member
Licensed customer
KeyCDN has a great instruction set for setting up a CDN under Xenforo 1.x but no instructions for 2.x and the 1.x instructions don't work (just makes all the dropdowns act strangely if you put in lines they suggest to the config file. Is there a clear set of instructions for how to setup a Xenforo 2.x site to use a CDN?
 
Same configuration as XenForo 1, I used KeyCDN for a longtime but I switched to CloudFlare for better protection and have pops in my country.

It can't be the exact same config as XF1 because XF1 has a base image path that needed to be changed and that is no longer in XF2, or at the very least I can't find it.
 
So... I now have an answer to my own question.

Per KeyCDN you want to add these two lines to config.php

Code:
$config['externalDataUrl'] = 'http://yourzone-ab12.kxcdn.com/data';
$config['javaScriptUrl'] = 'http://yourzone-ab12.kxcdn.com/js';

However, that didn't work for us. We had to alter two things:

1) Because we are using SSL we had to change http to https
2) Because our forums are at /forums and not in the root we had to add /forums to the end of the string. Our final lines look like this:

Code:
$config['externalDataUrl'] = 'https://yourzone-ab12.kxcdn.com/forums/data';
$config['javaScriptUrl'] = 'https://yourzone-ab12.kxcdn.com/forums/js';

Hope this helps anyone else moving forward.
 
Back
Top Bottom