



Multiple Origins
The Multiple Origins script config allows users to set up a service or services to use different origins based different patterns. This is generally useful when a single service is used to cache and serve content from different reverse proxy origins.
To add a Multiple Origins script config to the list of script configs created for your CacheFly services in general, or to associate a Multiple Origins script config with a specific CacheFly service, see Adding and Using Script Configs.
Using the Multiple Origins Script Config
Below is an example YAML configuration of the Multiple Origins script config where you will see different sections used in this config:
# This is a list of 3 origins which the service could use.
origins:
example: # friendly origin name
hostname: www.example.com # origin hostname
prepend: / # prepend path
foo:
hostname: foo.com
prepend: /
cachefly:
hostname: cachefly.com
prepend: /
# This is the default origin rule for the linked services.
default:
origin:
overridePortal: true # if true, this will override the origin host configured in the Reverse Proxy
primary: example # friendly name from the origins above
# These are the exceptions to the configured default rule.
exceptions:
# Requests starting with /foo/ in the path will be sent to "foo" origin.
- path: /foo/
origin:
overridePortal: true
primary: foo
# Requests starting with /textfiles/ and requesting files with .txt extension will be sent to "cachefly" origin.
- path: /textfiles/
extensions:
- .txt
origin:
overridePortal: true
primary: cachefly
# Requests starting with /t2/ and matching one of the pathFilters will be sent to "cachefly" origin.
- path: /t2/
pathFilter:
- "/t2/xyz/*/abc/"
- "/t2/zyx/*/aaa/"
origin:
overridePortal: true
primary: cachefly
Editing the Multiple Origins Script Config
When you add the Multiple Origins script config to your list of script configs in CacheFly, it will initially display a default configuration as a model for you to adapt to your own requirements.
To edit this default configuration:
Click the blue Edit button to enter edit mode
Modify the script config as you require
Remember to click the blue ✔ Save Changes button to save your changes.
As you edit:
The CacheFly system shows on-screen prompts to help you select acceptable parameters and values.
The blue ✔ Save Changes button will be partially grayed out and will be inactive, until the system confirms that your edits are acceptable.
You can cancel your current edits by clicking the gray Cancel button.
After editing:
Once you are done editing, you may need to activate the script config if it's not already active
To activate, click the Activate button to the upper right of of the Edit button
Scroll the graphics in this step horizontally to see all the screens.

Additional Help Topics
As an alternative to creating and managing script configs via the CacheFly user interface as described in this guide, you can also create and manage script configs via API calls.
Click the gray API docs button to access the Script Configs section in CacheFly's online API documentation for further information.


