> ## Documentation Index
> Fetch the complete documentation index at: https://docs-v1.agno.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Use Custom Domain and HTTPS

## Use a custom domain

1. Register your domain with [Route 53](https://us-east-1.console.aws.amazon.com/route53/).
2. Point the domain to the loadbalancer DNS.

### Custom domain for your Streamlit App

Create a record in the Route53 console to point `app.[YOUR_DOMAIN]` to the Streamlit App.

<img src="https://mintcdn.com/agno/QZOB15dhrj4yAmBd/images/llm-app-aidev-run.png?fit=max&auto=format&n=QZOB15dhrj4yAmBd&q=85&s=0c9f26629037b3b503e4e64a9432714c" alt="llm-app-aidev-run" width="1081" height="569" data-path="images/llm-app-aidev-run.png" />

You can visit the app at [http://app.aidev.run](http://app.aidev.run)

<Note>Note the `http` in the domain name.</Note>

### Custom domain for your FastAPI App

Create a record in the Route53 console to point `api.[YOUR_DOMAIN]` to the FastAPI App.

<img src="https://mintcdn.com/agno/QZOB15dhrj4yAmBd/images/llm-api-aidev-run.png?fit=max&auto=format&n=QZOB15dhrj4yAmBd&q=85&s=48e46ec49b5e751848b406f794370cf3" alt="llm-api-aidev-run" width="1081" height="569" data-path="images/llm-api-aidev-run.png" />

You can access the api at [http://api.aidev.run](http://api.aidev.run)

<Note>Note the `http` in the domain name.</Note>

## Add HTTPS

To add HTTPS:

1. Create a certificate using [AWS ACM](https://us-east-1.console.aws.amazon.com/acm). Request a certificat for `*.[YOUR_DOMAIN]`

<img src="https://mintcdn.com/agno/QZOB15dhrj4yAmBd/images/llm-app-request-cert.png?fit=max&auto=format&n=QZOB15dhrj4yAmBd&q=85&s=d862be76da04a190b9183aa3f24a6236" alt="llm-app-request-cert" width="1105" height="581" data-path="images/llm-app-request-cert.png" />

2. Creating records in Route 53.

<img src="https://mintcdn.com/agno/QZOB15dhrj4yAmBd/images/llm-app-validate-cert.png?fit=max&auto=format&n=QZOB15dhrj4yAmBd&q=85&s=ca798dabc4323409ff84f449a4ad4b39" alt="llm-app-validate-cert" width="1322" height="566" data-path="images/llm-app-validate-cert.png" />

3. Add the certificate ARN to Apps

<Note>Make sure the certificate is `Issued` before adding it to your Apps</Note>

Update the `llm-app/workspace/prd_resources.py` file and add the `load_balancer_certificate_arn` to the `FastAPI` and `Streamlit` Apps.

```python workspace/prd_resources.py theme={null}

# -*- Streamlit running on ECS
prd_streamlit = Streamlit(
    ...
    # To enable HTTPS, create an ACM certificate and add the ARN below:
    load_balancer_enable_https=True,
    load_balancer_certificate_arn="arn:aws:acm:Region:444455556666:certificate/certificate_ID",
    ...
)

# -*- FastAPI running on ECS
prd_fastapi = FastApi(
    ...
    # To enable HTTPS, create an ACM certificate and add the ARN below:
    load_balancer_enable_https=True,
    load_balancer_certificate_arn="arn:aws:acm:Region:444455556666:certificate/certificate_ID",
    ...
)
```

4. Create new Loadbalancer Listeners

Create new listeners for the loadbalancer to pickup the HTTPs configuration.

<CodeGroup>
  ```bash terminal theme={null}
  ag ws up --env prd --infra aws --name listener
  ```

  ```bash shorthand theme={null}
  ag ws up -e prd -i aws -n listener
  ```
</CodeGroup>

<Note>The certificate should be `Issued` before applying it.</Note>

After this, `https` should be working on your custom domain.

5. Update existing listeners to redirect HTTP to HTTPS

<CodeGroup>
  ```bash terminal theme={null}
  ag ws patch --env prd --infra aws --name listener
  ```

  ```bash shorthand theme={null}
  ag ws patch -e prd -i aws -n listener
  ```
</CodeGroup>

After this, all HTTP requests should redirect to HTTPS automatically.
