> ## Documentation Index
> Fetch the complete documentation index at: https://bunnynet-cb9733c2-stream-portrait-video-nathan.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-stream-portrait-video-nathan/cCJj1KQjbYWszKzL/images/docs/1ef14f4c14be1d252dfecd23dac3a6d6d81394af6f5ee821323f7c8e78203ad2-image.png?fit=max&auto=format&n=cCJj1KQjbYWszKzL&q=85&s=e6fbb66be8a8b28dce027416e25cf481" 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-stream-portrait-video-nathan/t1wsE4unUof78DuW/images/docs/f0373c65fac9c4ee93c2a5bc2450ab4e31b921e1f89317d7d782099918044a65-image.png?fit=max&auto=format&n=t1wsE4unUof78DuW&q=85&s=98b6c6ae3990a7eb6bc9d4ea134cc03c" 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-stream-portrait-video-nathan/cCJj1KQjbYWszKzL/images/docs/81299b7686d70d6ddb86f019bfcfe9ab80f97bc154949c8ac1cfd1dac4563f1f-image.png?fit=max&auto=format&n=cCJj1KQjbYWszKzL&q=85&s=045d8be9b04ce8145b82037caeac2c16" 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-stream-portrait-video-nathan/NhbkPLhNUT8ixyoq/images/docs/08f7158fa6535905e68b635aca2e223d1818ab25753596466e881f51bbea8ee0-image.png?fit=max&auto=format&n=NhbkPLhNUT8ixyoq&q=85&s=c4b19fa72a9d6bf8155aeb01f177bc3e" 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-stream-portrait-video-nathan/cCJj1KQjbYWszKzL/images/docs/471a57e384cb41e7cbf6373ad1352046d6307207e105b0c0fe0b710096023f92-image.png?fit=max&auto=format&n=cCJj1KQjbYWszKzL&q=85&s=7ac082f828ab3f738e39203475b214fc" 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**.
