| title | Endpoints |
|---|---|
| description | Expose your container to the internet using CDN or Anycast endpoints. |
Once you have a deployed container, you can expose it to the internet using two endpoint types: CDN for HTTP(S) traffic or Anycast for direct IP access.
CDN endpoints route HTTP(S) traffic through bunny.net's edge network, improving performance and reducing latency based on user location.
For more information about CDN, see our [CDN documentation](https://bunny.net/academy/cdn/what-is-a-cdn-content-delivery-network/).To create a CDN endpoint:
-
Go to Magic Containers and select your container.
-
Click Endpoints, then Add New Endpoint.
- Select CDN as the type.
- 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.
- Click Add Endpoint.
Sticky sessions ensure all requests from a client are routed to the same server instance, maintaining session state across requests.
To enable sticky sessions:
- In the endpoint configuration, select Sticky Session.
-
Choose an identifier (headers like
X-Forwarded-FororUser-Agent, or cookies likeSessionID). -
Click Add Endpoint.
Anycast endpoints map your container to an Anycast IP address, routing requests to the nearest node for improved performance.
To create an Anycast endpoint:
-
Go to Magic Containers and select your container.
-
Click Endpoints, then Add New Endpoint.
- Select Anycast as the type.
-
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.
-
Click Add Endpoint.