# Manage a website's web proxy

> Put a domain behind Coritan's edge on its Proxy tab, then change its web proxy, point it at one of your servers or delete it.

Source: https://www.coritan.com/docs/websites/proxy/

In the dashboard:

- /dashboard/websites/…/proxy: https://www.coritan.com/dashboard/websites

A website's **Proxy** tab manages the web proxy for the domain itself, such as `example.com`. A *web proxy* receives the domain's traffic at Coritan's edge, applies HTTPS and the WAF, and forwards each request to your origin ([How web proxies work](/docs/proxies/web-proxies/)). Web proxies for names under the domain, such as `www.example.com`, are in [Edge Proxy](https://www.coritan.com/dashboard/proxies/web) and on the domain's **WAF** tab.

## Before you begin

- The domain is on your [Websites](https://www.coritan.com/dashboard/websites) list, registered with Coritan or with its DNS zone hosted here.
- To send the domain to one of your servers, you need a server on your account with an address and a port.
- Visitors reach the web proxy only when the domain resolves to Coritan's edge. When Coritan hosts the zone and the domain has no `A`, `AAAA` or `CNAME` record yet, the web proxy writes a proxied `A` or `AAAA` record for it. If the domain already has an `A` or `AAAA` record, turn **Proxied** on for it on the **DNS** tab.
- When another provider hosts the DNS, point the domain at the edge there. The **SSL** tab shows the address when you choose **HTTP validation** ([Issue a certificate with HTTP validation](/docs/websites/ssl/issue-a-certificate/#issue-a-certificate-with-http-validation)).

## Send the domain to one of your servers

1. In the dashboard, go to [Websites](https://www.coritan.com/dashboard/websites), open the domain and select the **Proxy** tab.
2. On the **Connect to one of your servers** card, choose the **Server**. The card shows the address and port that requests will go to.
3. Leave **Request a certificate automatically** on, so Coritan issues a certificate for the domain.
4. Select **Connect domain**.

The web proxy starts with **Force HTTPS**, **WebSockets** and **Web application firewall** on, and connects to the server over plain HTTP. If you have no server yet, the card shows **Order server** instead.

## Forward the domain to any origin

1. On the **Proxy** tab, select **New route…**.
2. Enter the **Origin host**, an IP address or a hostname such as `origin.example.net`, and its **Port**.
3. Choose the **Origin protocol**, and turn on **Connect to the origin over TLS** if the origin serves HTTPS on that port.
4. Choose the switches and, under **Advanced options**, any path, header or extra origin settings. [Create a web proxy](/docs/proxies/web-proxies/create-a-web-proxy/) describes each field.
5. Select **Create route**.

## Change the web proxy

The **Origin** card lists the web proxy's **Origins**, **Origin protocol**, **Path**, **Custom headers**, **Limits** and **Status**.

- To change them, select **Edit route…**, make the changes and select **Save changes**. [Change a web proxy's origin](/docs/proxies/web-proxies/change-the-origin/) explains each field.
- The **Switches** card turns **Force HTTPS**, **WebSockets**, **Web application firewall**, **TLS to origin** and **PROXY protocol to origin** on or off. Each switch saves as soon as you change it.
- The **Certificate** card has **Request certificate** and **Open SSL**. The **SSL** tab shows the certificate the edge serves for the domain ([How SSL/TLS certificates work](/docs/websites/ssl/)).
- **Open in Edge Proxy** opens the web proxy's own page, with its **Redirects** and **Error page** tabs. On a narrow screen, open the web proxy from [Edge Proxy](https://www.coritan.com/dashboard/proxies/web) instead.

## Repoint the domain at one of your servers

1. On the **Repoint at one of your servers** card, choose the **Server**.
2. Leave **Request a certificate automatically** on to request a new certificate at the same time.
3. Select **Repoint domain**.

Repointing replaces only the origin host and port with the server's address and port. The switches, path settings, headers and any additional origins stay as they are.

## Delete the web proxy

> [!WARNING]
> Deleting the web proxy deletes its settings, its redirect rules and its custom error page. Visitors who reach the edge for the domain see an error page until the domain has a web proxy again or its DNS points elsewhere.

1. On the **Delete this proxy route** card, select **Delete route…**.
2. Type the domain, such as `example.com`, to confirm.
3. Select **Delete route**.

The domain's DNS records stay as they are. A proxied record keeps sending visitors to the edge, so turn **Proxied** off for the record on the **DNS** tab to send them straight to your address ([Add, edit and delete DNS records](/docs/websites/dns/manage-dns-records/#edit-a-record)). The certificate stays on the **SSL** tab.

## Result

Each change shows a confirmation, such as `Route for example.com created.`, `example.com now points at 203.0.113.10:8080.` or `Proxy route for example.com deleted.`. The tab then shows the web proxy's origin, certificate and switches, or the two ways to create one.

## Troubleshooting

`A route for this domain already exists`
: The domain already has a web proxy that this tab does not show, such as the one a proxied `A` or `AAAA` record creates. Turn **Proxied** off for the domain's record on the **DNS** tab, create the web proxy, then turn **Proxied** on again. If the domain has no proxied record, [contact support](/docs/support/).

`Domain route owned by another user`
: Another account has a web proxy for the domain. [Contact support](/docs/support/).

`Server has no allocated IP/port. Ensure the server has an active allocation.`
: The server has no address and port yet. Wait until its setup finishes, or choose another server.

`Unable to resolve hostname: origin.example.net`
: The origin host does not resolve in public DNS. Check its spelling, or enter the origin's IP address.

`host targets a private or reserved network` or `resolved address targets a private or reserved network`
: The edge only forwards to public addresses. Enter the origin's public address.

The form refuses the origin host
: The **Origin host** takes a hostname or an IP address only, with no `https://` and no port. [Create a web proxy](/docs/proxies/web-proxies/create-a-web-proxy/#troubleshooting) lists the form's messages.

Visitors get a certificate warning
: The certificate is not issued yet, or its issuance failed. Open the **SSL** tab to see why ([Issue a certificate](/docs/websites/ssl/issue-a-certificate/#troubleshooting)).

Visitors see an error page from Coritan
: The edge cannot reach your origin. [Troubleshoot proxies and join addresses](/docs/proxies/troubleshooting/) covers each error.

## Related

- [How web proxies work](/docs/proxies/web-proxies/)
- [Create a web proxy](/docs/proxies/web-proxies/create-a-web-proxy/)
- [Protect a website with the WAF](/docs/websites/waf/)

## With the API

The **Proxy** tab uses the web proxy API, which [Create a web proxy](/docs/proxies/web-proxies/create-a-web-proxy/#with-the-api) and [Change a web proxy's origin](/docs/proxies/web-proxies/change-the-origin/#with-the-api) describe. To find the web proxy for a domain, list your web proxies and pick the one whose `domain` matches exactly:

```bash
curl "https://api.coritan.com/api/v1/proxy/routes?per_page=200" \
  -H "Authorization: Bearer $CORITAN_TOKEN"
```
