# Google CDN Configuration Guide

### Prerequisites:  <a href="#prerequisites" id="prerequisites"></a>

To be able to configure the reverse proxy on a Load Balancer in Google Cloud you should be either a project [owner or editor](https://cloud.google.com/iam/docs/understanding-roles#basic), or you should have the following roles: `roles/compute.networkAdmin` and `roles/compute.instanceAdmin`

***

## Implementation steps

### Step 1 Create the NEG and internet endpoint: <a href="#step-1-create-the-neg-and-internet-endpoint" id="step-1-create-the-neg-and-internet-endpoint"></a>

1. In the Google Cloud console, go to the **Network endpoint groups** page.

   [Go to Network endpoint groups](https://console.cloud.google.com/compute/networkendpointgroups/list)
2. Click **Create network endpoint group**.
3. Enter the name of the network endpoint group: `jentis-fqdn-neg`.
4. For **Network endpoint group type**, select **Internet NEG**.
5. For **Default port**, enter `443`.
6. For **New network endpoint**, select **Fully qualified domain name and port**.
7. For the FQDN, enter: hash of the JENTIS container as subdomain + . + website domain, e.g. [hash.yourwebsitedomain.com](http://hash.yourwebsitedomain.com/).
8. For **Port type**, select **Default**, and verify that **Port number** is `443`.
9. Click **Create**.\
   ![](/files/EPeYAJy4hd3yAI6RuJw6)

***

### Step 2: Create the backend service and add the internet NEG <a href="#step-2-create-the-backend-service-and-add-the-internet-neg" id="step-2-create-the-backend-service-and-add-the-internet-neg"></a>

1. In the Google Cloud console, go to the **Load balancing** page.

   [Go to Load balancing](https://console.cloud.google.com/networking/loadbalancing/list)
2. Select the classic Application Load Balancer of your website, and then select **Edit**.
3. Click **Backend configuration**.
4. In the **Backend services & backend buckets** menu, select **Create a backend service**.
5. Set the name of the backend service to `jentis`.
6. For **Backend type**, select **Internet network endpoint group**.
7. Select the protocol **HTTPS**.
8. Under **New backend > Internet network endpoint group**, select `jentis-fqdn-neg`, and then click **Done**.
9. Select **Disable Cloud CDN**.
10. In **Advanced configurations**, under **Custom request headers**, click **Add header**.
    1. For **Header name**, enter `Host`.
    2. For **Header value**, enter `hash.yourwebsitedomain.com`.
11. Click **Create**.\
    ![](/files/DAzKhQQUqJC8buL5juhw)
12. Attach the backend service to an existing URL map
    1. Click **Host and path rules**.
    2. The first row or rows have Google Cloud services in the right column, and one of them is already populated with the default rule `Any unmatched (default)` for **Hosts** and **Paths**.
    3. Ensure that there is a row with `jentis` selected in the right column. If it doesn't exist, click **Add host and path rule**, and select `jentis`. Populate the other fields as follows:
       1. In **Hosts**, enter `*`.
       2. In **Paths**, enter '/' and the hash of the container: `/hash`.\
          ![](/files/xnonErghITFFhnaY4kow)

          &#x20;
    4. Click **Update**

{% 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 %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.jentis.com/key-features/cookie-lifetime-extender/cookie-lifetime-extender-webserver-cdn-configurations/google-cdn-configuration-guide.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
