> ## Documentation Index
> Fetch the complete documentation index at: https://bunnynet-cb9733c2-claude-jolly-knuth-4rxce7.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-claude-jolly-knuth-4rxce7/yfMhijbeolf7ycaz/images/docs/1ef14f4c14be1d252dfecd23dac3a6d6d81394af6f5ee821323f7c8e78203ad2-image.png?fit=max&auto=format&n=yfMhijbeolf7ycaz&q=85&s=b9138b8212adade17a69b0aa5d639603" 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-claude-jolly-knuth-4rxce7/waRmewxu_vg2oMTh/images/docs/f0373c65fac9c4ee93c2a5bc2450ab4e31b921e1f89317d7d782099918044a65-image.png?fit=max&auto=format&n=waRmewxu_vg2oMTh&q=85&s=cc70fe4c64485865b5202ce0e490ffec" 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-claude-jolly-knuth-4rxce7/iDZMErh86cNxE5HQ/images/docs/81299b7686d70d6ddb86f019bfcfe9ab80f97bc154949c8ac1cfd1dac4563f1f-image.png?fit=max&auto=format&n=iDZMErh86cNxE5HQ&q=85&s=2418839e0c8bec0ef6379764c51504b0" 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-claude-jolly-knuth-4rxce7/yfMhijbeolf7ycaz/images/docs/08f7158fa6535905e68b635aca2e223d1818ab25753596466e881f51bbea8ee0-image.png?fit=max&auto=format&n=yfMhijbeolf7ycaz&q=85&s=4e6a791e325ef16e5f4459e71301bc8c" 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-claude-jolly-knuth-4rxce7/yfMhijbeolf7ycaz/images/docs/471a57e384cb41e7cbf6373ad1352046d6307207e105b0c0fe0b710096023f92-image.png?fit=max&auto=format&n=yfMhijbeolf7ycaz&q=85&s=e62a02dec1b9dfb4d1ba24eb01069201" 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**.
