Skip to content

Commit 175822d

Browse files
author
markzegarelli
committed
updated proxy intructions #1975 [netlify-build]
1 parent 0673b30 commit 175822d

File tree

1 file changed

+38
-122
lines changed
  • src/connections/sources/catalog/libraries/website/javascript

1 file changed

+38
-122
lines changed

src/connections/sources/catalog/libraries/website/javascript/custom-proxy.md

Lines changed: 38 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ To set up a custom domain, you need:
1313
1. Access to your site DNS settings
1414
2. A CDN you can serve assets from
1515
3. Access to the CDN settings
16+
4. A security certificate for the proxy domain
1617

17-
This guide explains how to set up a custom domain in CloudFront. The same principles can be applied to almost any modern CDN that supports proxies.
18+
This guide explains how to set up a custom domain in CloudFront. You can apply these principles to almost any modern CDN that supports proxies.
1819

1920
You need to set up two important parts, regardless of the CDN provider you use:
2021

@@ -36,146 +37,61 @@ This is {person} from {company}. I would like to configure a proxy for the follo
3637

3738
Double-check the source link, the Source ID, and the API proxy host to make sure they are correct.
3839

39-
A Segment Customer Success team member will respond that they have enabled this option for your account. When you receive this confirmation, open the source in your workspace, and navigate to Settings > Analytics.j. Modify the **Host Address** setting from `api.segment.io/v1` to `[your proxy host]/v1`.
40+
A Segment Customer Success team member will respond that they have enabled this option for your account. When you receive this confirmation, open the source in your workspace, and navigate to Settings > Analytics.j. Update the **Host Address** setting from `api.segment.io/v1` to `[your proxy host]/v1`.
4041

4142
> info ""
42-
> The **Host Address** field does not appear in source settings until it is enabled by Segment Customer Success.
43+
> The **Host Address** field does not appear in source settings until it's enabled by Segment Customer Success.
4344
4445
## CloudFront
4546

47+
These instructions refer to Amazon CloudFront, but apply more generally to other providers as well.
48+
4649
### CDN Proxy
4750

48-
First log in to AWS and navigate to CloudFront.
49-
50-
![](images/create_cloudfront_distribution.png)
51-
52-
Click **Create Distribution**.
53-
54-
Select a delivery method for your content. Click **Get Started** in the **Web** section.
55-
56-
![](images/cloudfront_distribution_web.png)
57-
58-
Next, configure the distribution settings. Under Origin Settings, update the following values:
59-
60-
![](images/cloudfront_distribution_settings.png)
61-
62-
<table>
63-
<tr>
64-
<td>**Field**</td>
65-
<td>**Value**</td>
66-
<td>**Description**</td>
67-
</tr>
68-
<tr>
69-
<td>Origin Domain Name</td>
70-
<td>`cdn.segment.com`</td>
71-
<td>The domain name you want the proxy to be served to</td>
72-
</tr>
73-
<tr>
74-
<td>Origin ID (optional)</td>
75-
<td>The Segment CDN</td>
76-
<td>A Description of the origin. This can be anything you want that describes the origin domain name.</td>
77-
</tr>
78-
<tr>
79-
<td>Origin Protocol Policy</td>
80-
<td>Set to `HTTPS Only`</td>
81-
<td></td>
82-
</tr>
83-
<tr>
84-
<td>Alternate Domain Names (CNAMEs)</td>
85-
<td>`analytics.yourdomain.com`</td>
86-
<td>Enter the subdomain you are using as a proxy to Segment. If you don't do this you will get an error.</td>
87-
</tr>
88-
</table>
89-
90-
Next, configure the **Default Cache Behavior Settings**.
91-
92-
<table>
93-
<tr>
94-
<td>**Field**</td>
95-
<td>**Value**</td>
96-
<td>**Description**</td>
97-
</tr>
98-
<tr>
99-
<td>Viewer Protocol Policy</td>
100-
<td>Redirect HTTP to HTTPS</td>
101-
<td>Ensure that all traffic goes through HTTPS</td>
102-
</tr>
103-
<tr>
104-
<td>Allowed HTTP Methods</td>
105-
<td>GET, HEAD, OPTIONS, PUT, POST, PATCH, DELETE</td>
106-
<td>Select which HTTP methods are allowed to be proxied.</td>
107-
</tr>
108-
<tr>
109-
<td>Forward Cookies</td>
110-
<td>All</td>
111-
<td>Ensure that cookies are forwarded.</td>
112-
</tr>
113-
<tr>
114-
<td>Query String Forwarding and Caching</td>
115-
<td>Forward all, cache based on all</td>
116-
<td>Ensure that all query string values are forwarded and properly cached.</td>
117-
</tr>
118-
</table>
119-
120-
Click **Create Distribution** at the bottom of the page. This distribution displays as being "In Progress" until it finishes deploying.
121-
122-
You need the "Domain Name" for the next step, so keep this browser window open.
51+
1. First log in to the AWS console and navigate to CloudFront.
52+
2. Click **Create Distribution**.
53+
3. Configure the distribution settings. In the Origin section, update the following values:
54+
- **Origin Domain Name**: `cdn.segment.com`
55+
- **Protocol**: `HTTPS only`
56+
4. In the Default cache behavior section, configure the following values:
57+
- **Viewer protocol policy**: `Redirect HTTP to HTTPS`
58+
- **Allowed HTTP Methods**: `GET, HEAD, OPTIONS, PUT, POST, PATCH, DELETE`
59+
5. In the Settings section, configure the following values:
60+
- **Alternate domain name (CNAME)**: `analytics.<yourdomain>.com`
61+
- **Custom SSL certificate**: Select an existing or select a new certificate to validate the authorization to use the **Alternate domain name (CNAME)** value. For more information, see Amazon's documentation [Requirements for using alternate domain names](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/CNAMEs.html#alternate-domain-names-requirements){:target="_blank"}
62+
6. Click **Create Distribution**.
63+
64+
Take note of the Domain Name, for use in the next step.
12365

12466
#### Add CNAME Record to DNS
12567

12668
Next, add a CNAME record for the Segment proxy to your organizations DNS settings. Use a name that makes it clear what you are using the subdomain for, for example `analytics.mysite.com`. Go to your domain registrar and add a new record to your DNS of type "CNAME".
12769

128-
<table>
129-
<tr>
130-
<td>**Field**</td>
131-
<td>**Value**</td>
132-
</tr>
133-
<tr>
134-
<td>Name</td>
135-
<td>{subdomain_name}.yourdomain.com</td>
136-
</tr>
137-
<tr>
138-
<td>Value</td>
139-
<td>CloudFront Distribution Domain Name</td>
140-
</tr>
141-
</table>
142-
143-
Save your record. This might take some time to take effect, depending on your TTL settings. Make a `curl` request to your domain to verify that it's proxying correctly.
70+
71+
| Field | Value |
72+
| ----- | --------------------------------------- |
73+
| Name | `<subdomain_name>.yourdomain.com` |
74+
| Value | *The Domain Name value from CloudFront* |
75+
76+
Save your record. This might take some time to take effect, depending on your TTL settings. Make a `curl` request to your domain to verify that the proxy works.
14477

14578
### Tracking API Proxy
14679

147-
Next, set up a proxy for the tracking API so that all calls are proxied through your domain. In this step, we set up a CloudFront distribution that's very similar to the previous step, with a few minor changes:
148-
149-
<table>
150-
<tr>
151-
<td>**Field**</td>
152-
<td>**Value**</td>
153-
<td>**Description**</td>
154-
</tr>
155-
<tr>
156-
<td>Origin Domain Name</td>
157-
<td>`api.segment.io`</td>
158-
<td>The domain name you would like the proxy to be served to</td>
159-
</tr>
160-
</table>
80+
Next, set up a proxy for the tracking API so that all calls proxy through your domain. In this step, set up a CloudFront distribution that's similar to the previous step, with the exception of the Origin Domain Name:
81+
82+
| Field | Value | Description |
83+
| ------------------ | ---------------- | -------------------------------------------- |
84+
| Origin Domain Name | `api.segment.io` | The domain name to which the proxy is served |
85+
16186

16287
#### Add CNAME Record to DNS
16388

16489
Next, add a CNAME record to your DNS settings. Go to your domain registrar and add a new record to your DNS of type "CNAME". This time use the CloudFront distribution for the tracking API proxy.
16590

166-
<table>
167-
<tr>
168-
<td>**Field**</td>
169-
<td>**Value**</td>
170-
</tr>
171-
<tr>
172-
<td>Name</td>
173-
<td>{subdomain_name}.yourdomain.com</td>
174-
</tr>
175-
<tr>
176-
<td>Value</td>
177-
<td>Tracking API CloudFront Distribution Domain Name</td>
178-
</tr>
179-
</table>
91+
| Field | Value |
92+
| ----- | -------------------------------------------------- |
93+
| Name | `<subdomain_name>.yourdomain.com` |
94+
| Value | *Tracking API CloudFront Distribution Domain Name* |
95+
18096

18197
Save your record. This might take some time to take effect, depending on your TTL settings. Try running `curl` on your domain to check if the proxy is working correctly.

0 commit comments

Comments
 (0)