> ## Documentation Index
> Fetch the complete documentation index at: https://bunnynet-cb9733c2-support-migration.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-support-migration/Z09ZI7FyatCuoSuT/images/docs/1ef14f4c14be1d252dfecd23dac3a6d6d81394af6f5ee821323f7c8e78203ad2-image.png?fit=max&auto=format&n=Z09ZI7FyatCuoSuT&q=85&s=97b0ec8fd359829f88fe6707d8b2b866" 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-support-migration/w32H-OuMiEPPh72G/images/docs/f0373c65fac9c4ee93c2a5bc2450ab4e31b921e1f89317d7d782099918044a65-image.png?fit=max&auto=format&n=w32H-OuMiEPPh72G&q=85&s=ec991c31b5ae3e75781b848813ba0ff7" 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-support-migration/RpQ-CUm87OlkPU-U/images/docs/81299b7686d70d6ddb86f019bfcfe9ab80f97bc154949c8ac1cfd1dac4563f1f-image.png?fit=max&auto=format&n=RpQ-CUm87OlkPU-U&q=85&s=3721561097b5a8974452530598ba0554" 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-support-migration/Z09ZI7FyatCuoSuT/images/docs/08f7158fa6535905e68b635aca2e223d1818ab25753596466e881f51bbea8ee0-image.png?fit=max&auto=format&n=Z09ZI7FyatCuoSuT&q=85&s=16f03307190387f12506abff64d99607" 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-support-migration/Z09ZI7FyatCuoSuT/images/docs/471a57e384cb41e7cbf6373ad1352046d6307207e105b0c0fe0b710096023f92-image.png?fit=max&auto=format&n=Z09ZI7FyatCuoSuT&q=85&s=adb5bc093d570f276d169da2a43faaa0" 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**.
