Overview
You can use this document to learn how to update a StackPath origin for an existing site.
Stackpath uses an origin to retrieve your content for delivery to your end users.
When an end user requests content that is not present in the CDN, StackPath will need to know where your content is located and how to retrieve the content for delivery.
To configure a cloud storage bucket for your origin, see:
Update origin via the portal
- In the StackPath Control, in the left-side navigation, click Sites.
- Locate and select the desired site.
- In the left-side navigation, click Settings.
- In the field next to Address, enter a direct IP address or a domain name:
- If you enter a direct IP address, then StackPath will pull directly from your server.
- If you ever migrate to a separate hosting provider, then you will need to update this field.
- If you enter a domain name, then StackPath will resolve your server IP through the DNS for any origin pull.
- If you ever migrate to a separate hosting provider, then you do not need to update this field.
- If your domain points to the StackPath Anycast IP or Edge Address for your website, then you may generate some errors when you enter a domain name.
- If you enter a direct IP address, then StackPath will pull directly from your server.
- Click Save.
Update origin via the API
- In the StackPath Control, in the top, right corner, click your username.
- Click My Stacks.
- Locate and select the desired stack.
- Copy your stack ID, which is displayed in the URL.
https://control.stackpath.com/stacks/<this-is-your-stack-id>
-
Retrieve a list of origin IDs that will be needed to update with the origin IP. All origin IDs will be listed for the account, so you must parse through the list to locate the desired origin to update.
curl -H "Authorization: Bearer <token>" -H "Content-type: application/json" "https://gateway.stackpath.com/cdn/v1/stacks/<origin_id>/origins"
- Run the following command to push your changes to the zone configurations. StackPath will immediately redirect Origin pulls to the new IP address or hostname.
- For path, if you are unsure of a path to set, then enter your website's root ( / ).
- For hostname, do not enter a protocol (HTTP or HTTPS).
- (Optional) For port, enter your HTTP port. You can enter 80 or a custom port.
- (Optional) For securePort, enter your HTTPS port. You an enter 443 or a custom port.
curl -H "Content-Type: application/json" -H 'authorization: Bearer <token>' -X PATCH https://gateway.stackpath.com/cdn/v1/stacks/<stack_id>/origins/<origin_id> -d '{"path": "string", "hostname": "string", "port": int, "securePort": int}'
View additional origin settings
Feature | Description |
Origin backup |
To use a backup origin, enter another address to be used in the event that the default address returns a 400 or 500 class error. To learn more, see How-To Use a Backup CDN Origin. |
Origin host header |
This setting is used as the host request header that StackPath sends to your origin when pulling content. This setting needs to be set to your URL's version that your website responds to. If this setting is misconfigured, then StackPath may have trouble locating your content. The default list is taken from Delivery Domains you have configured, but a custom header is always configurable. |
Origin pull protocol |
This setting is the protocol that StackPath uses to contact the origin.
This setting allows StackPath to appropriately pull content from the desired origin.
There are 3 options:
|