# Amazon CloudFront (AWS) Configuration Guide

### **Introduction** <a href="#amazoncloudfront-aws-configurationguide-introduction" id="amazoncloudfront-aws-configurationguide-introduction"></a>

To forward requests to JENTIS via CloudFront, we need to add a new custom origin to the CloudFront distribution and define a behavior for the origin.

***

### **Prerequesits** <a href="#amazoncloudfront-aws-configurationguide-prerequesits" id="amazoncloudfront-aws-configurationguide-prerequesits"></a>

* Admin access to the AWS Management Console.

***

### **Step 1: Create Origin** <a href="#amazoncloudfront-aws-configurationguide-step1-createorigin" id="amazoncloudfront-aws-configurationguide-step1-createorigin"></a>

1. Sign in to the AWS Management Console and open the CloudFront console at <https://console.aws.amazon.com/cloudfront/v4/home>.
2. Navigate to Distributions
3. Open the distribution for your website
4. Navigate to Origins
5. Click Create origin<br>

   <figure><img src="https://2315305008-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy15ncufYr341K5U8q6Of%2Fuploads%2FJCt3xeeBHGYaOqyQB1AI%2Fimage.png?alt=media&#x26;token=f31b62a7-3240-422b-af65-373b306c9667" alt=""><figcaption></figcaption></figure>
6. Specify the following:
   1. Origin domain: `hash of the JENTIS container as subdomain` + `.` + `website domain`, e.g. [hash.yourwebsitedomain.com](http://hash.yourwebsitedomain.com/)
   2. Protocol: HTTPS
   3. Port: 443
   4. MinimumSSL protocol: TLSv1.2
   5. Name: [hash.yourwebsitedomain.com](http://hash.yourwebsitedomain.com/) (or any other)
   6. Enable Origin Shield: No<br>

      <figure><img src="https://2315305008-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy15ncufYr341K5U8q6Of%2Fuploads%2F1A7ETjlkjd1HGXlSNKVD%2Fimage.png?alt=media&#x26;token=eed3bacb-6ffa-4c11-b8fa-37784890c4e7" alt=""><figcaption></figcaption></figure>
7. Press Create Origin

***

### **Step 2: Define Behavior** <a href="#amazoncloudfront-aws-configurationguide-step2-definebehavior" id="amazoncloudfront-aws-configurationguide-step2-definebehavior"></a>

1. In your website distribution go to Behaviors;
2. Click Create behavior<br>

   <figure><img src="https://2315305008-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy15ncufYr341K5U8q6Of%2Fuploads%2F1O2jZRBj98BHhdy3ZTUe%2Fimage.png?alt=media&#x26;token=8faae165-d326-452a-89f7-578c0e2f5e2c" alt=""><figcaption></figcaption></figure>
3. Specify the following:
   1. Path pattern: '/' + hash of the tracking container, e.g /hash
   2. Origin and origin groups: [hash.yourwebsitedomain.com](http://hash.yourwebsitedomain.com/) (origin from the previous step)
   3. Compress objects automatically: No
   4. Viewer protocol policy: HTTPS Only
   5. Allowed HTTP methods: GET, HEAD, OPTIONS, PUT, POST, PATCH, DELETE
   6. Cache HTTP methods: disabled
   7. Allow gRPC requests over HTTP/2: disabled
   8. Restrict viewer access: No
   9. Cache key and origin requests → Cache policy: CachingDisabled
   10. Cache key and origin requests → Origin request policy: None
   11. Cache key and origin requests → Response headers policy: None<br>

       <figure><img src="https://2315305008-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy15ncufYr341K5U8q6Of%2Fuploads%2Fphhf2k0H76lay78WRwE3%2Fimage.png?alt=media&#x26;token=71d1d8dc-a014-426a-b280-1c74e405bf92" alt=""><figcaption></figcaption></figure>
4. Press Create Behavior

***

### **Conclusion** <a href="#amazoncloudfront-aws-configurationguide-conclusion" id="amazoncloudfront-aws-configurationguide-conclusion"></a>

You have now created your new custom behaviour, and your request will be forwarded from now on.

{% hint style="danger" %}
After enabling Cookie lifetime extender, the DCP will give a proxy code that is expected to be setup on `https://domain.*/hash` however, if it is set up on `https://www.domain.*/hash` it will cause a CORS Error on the Cookie Lifetime Extender Requests.

For more details on WWW configuration follow this [guide](https://docs.jentis.com/key-features/cookie-lifetime-extender/configure-your-tracking#www-configuration-guide-optional).
{% endhint %}

***

If you have any questions or suggestions, contact us through our [Helpdesk](https://jentis.atlassian.net/servicedesk/customer/portal/1).
