# Setting up a Reverse Proxy in AWS CloudFront

div
strong
⚠️ Warning:
 This guide provides a general overview of the configuration process. Technical requirements vary by environment; always consult your internal IT or security teams before applying these settings. If you would like to complete this setup with a Foleon technical expert, please contact 
strong
Foleon Support
 or your 
strong
Customer Success Manager.
## 1. Adding your domain into Foleon

- login to Foleon
- go to "Domains" in the Admin Console (or your workspace)
- Use HTTPS protocol to ensure End to End encryption
- Click "Create new Domain"
- Fill in the domain
- Click the checkbox for reverse proxy
- (optional) enter your certificate details
- Click "save"


domains.gif
## 2. Configure the Origin

In your CloudFront Distribution, create a new Origin:

- **Origin Domain:** `s1.foleon.com` (EU) or `s1.us.foleon.com` (US).
- **Protocol:** `HTTPS only`.
- **Name:** Give it a clear name like `FoleonOrigin`.


## 3. Create a Cache Behavior

Create a new Behavior to "catch" the Foleon path:

- **Path Pattern:** `/en/guides/*`. (example)
- **Origin:** Select the `FoleonOrigin` created in Step 2.
- **Viewer Protocol Policy:** `Redirect HTTP to HTTPS`.
- **Allowed HTTP Methods:** `GET`, `HEAD`, `OPTIONS`, `PUT`, `POST`, `PATCH`, `DELETE`


div

  Change 
code
/en/guides/*
 to your preferred base path. For example: 
code
/publications/*
code
## 4. Headers & Policies

Foleon requires the original Host header to identify your project.

- **Origin Request Policy:** Select the managed policy `AllViewer` (this ensures `Host`, `User-Agent`, and other headers are forwarded).
- **Alternatively (Custom):** If creating a custom policy, you must allow-list the Host header. CloudFront will automatically include standard `X-Forwarded-For` headers.


## 5. Deploy and Test

- **Deploy:** Save changes and wait for the status to reach "Deployed" (usually 3–15 minutes).
- **Verify:** Navigate to `https://yourdomain.com/en/guides/`. You should see a Foleon `404` page. This confirms CloudFront is correctly talking to Foleon.
- **Success:** Once you complete Step 6, your content will load.


## 6. Apply a domain to a project

1. Login to foleon.
2. Go to project settings.
3. Select the newly created domain.
4. Setup the basepath / subfolder you want to use to publish your documents on.
5. Make sure to publish a document in this project.


div
strong
TIP:
 You can setup multiple projects with the same basepath e.g. 
code
/en/guide/finance/
 and 
code
/en/guide/legal/