> ## Documentation Index
> Fetch the complete documentation index at: https://bunnynet-cb9733c2-database-cli-docs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Endpoints

> Expose your container to the internet using CDN or Anycast endpoints.

Once you have a [deployed container](/magic-containers/quickstart), you can expose it to the internet using two endpoint types: **CDN** for HTTP(S) traffic or **Anycast** for direct IP access.

## CDN

CDN endpoints route HTTP(S) traffic through bunny.net's edge network, improving performance and reducing latency based on user location.

<Info>
  For more information about CDN, see our [CDN
  documentation](https://bunny.net/academy/cdn/what-is-a-cdn-content-delivery-network/).
</Info>

To create a CDN endpoint:

1. Go to **Magic Containers** and select your container.

2. Click **Endpoints**, then **Add New Endpoint**.

<Frame>
  <img src="https://mintcdn.com/bunnynet-cb9733c2-database-cli-docs/eoniXs4WeprVRrn8/images/docs/1ef14f4c14be1d252dfecd23dac3a6d6d81394af6f5ee821323f7c8e78203ad2-image.png?fit=max&auto=format&n=eoniXs4WeprVRrn8&q=85&s=412b9b706be9fff37a922302bef301a8" alt="" width="2418" height="1340" data-path="images/docs/1ef14f4c14be1d252dfecd23dac3a6d6d81394af6f5ee821323f7c8e78203ad2-image.png" />
</Frame>

3. Select **CDN** as the type.

<Frame>
  <img src="https://mintcdn.com/bunnynet-cb9733c2-database-cli-docs/PCoi_cl26npeenM8/images/docs/f0373c65fac9c4ee93c2a5bc2450ab4e31b921e1f89317d7d782099918044a65-image.png?fit=max&auto=format&n=PCoi_cl26npeenM8&q=85&s=79aaf60176d0380447ce3ae22ad82428" alt="" width="1366" height="1758" data-path="images/docs/f0373c65fac9c4ee93c2a5bc2450ab4e31b921e1f89317d7d782099918044a65-image.png" />
</Frame>

4. Configure the endpoint:
   * **Name**: A unique name for this endpoint.
   * **Container Port**: The port your application listens on.
   * **SSL for origin**: Enable if your application uses SSL internally.

<Info>
  It's recommended to run one process per container. If running multiple
  processes, ensure they use different ports.
</Info>

5. Click **Add Endpoint**.

### Sticky sessions

Sticky sessions ensure all requests from a client are routed to the same server instance, maintaining session state across requests.

To enable sticky sessions:

1. In the endpoint configuration, select **Sticky Session**.

<Frame>
  <img src="https://mintcdn.com/bunnynet-cb9733c2-database-cli-docs/N98C2ocTlrI_4JGH/images/docs/81299b7686d70d6ddb86f019bfcfe9ab80f97bc154949c8ac1cfd1dac4563f1f-image.png?fit=max&auto=format&n=N98C2ocTlrI_4JGH&q=85&s=1d8d57064728521b4940c35fbfd198f7" alt="" width="1348" height="1052" data-path="images/docs/81299b7686d70d6ddb86f019bfcfe9ab80f97bc154949c8ac1cfd1dac4563f1f-image.png" />
</Frame>

2. Choose an identifier (headers like `X-Forwarded-For` or `User-Agent`, or cookies like `SessionID`).

3. Click **Add Endpoint**.

## Anycast

Anycast endpoints map your container to an Anycast IP address, routing requests to the nearest node for improved performance.

To create an Anycast endpoint:

1. Go to **Magic Containers** and select your container.

2. Click **Endpoints**, then **Add New Endpoint**.

<Frame>
  <img src="https://mintcdn.com/bunnynet-cb9733c2-database-cli-docs/eoniXs4WeprVRrn8/images/docs/08f7158fa6535905e68b635aca2e223d1818ab25753596466e881f51bbea8ee0-image.png?fit=max&auto=format&n=eoniXs4WeprVRrn8&q=85&s=6c5b29a957a21f991778eae632853dbb" alt="" width="2418" height="1340" data-path="images/docs/08f7158fa6535905e68b635aca2e223d1818ab25753596466e881f51bbea8ee0-image.png" />
</Frame>

3. Select **Anycast** as the type.

<Frame>
  <img src="https://mintcdn.com/bunnynet-cb9733c2-database-cli-docs/eoniXs4WeprVRrn8/images/docs/471a57e384cb41e7cbf6373ad1352046d6307207e105b0c0fe0b710096023f92-image.png?fit=max&auto=format&n=eoniXs4WeprVRrn8&q=85&s=1c78c713a2c321ae319c7043283efe01" alt="" width="1348" height="1700" data-path="images/docs/471a57e384cb41e7cbf6373ad1352046d6307207e105b0c0fe0b710096023f92-image.png" />
</Frame>

4. Configure the endpoint:
   * **Name**: A unique name for this endpoint.
   * **Container Port**: The port your application listens on inside the container.
   * **Exposed Port**: The port available on the Anycast IP.

5. Click **Add Endpoint**.
