Skip to main content
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

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.
To create a CDN endpoint:
  1. Go to Magic Containers and select your container.
  2. Click Endpoints, then Add New Endpoint.
  1. Select CDN as the type.
  1. 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.
It’s recommended to run one process per container. If running multiple processes, ensure they use different ports.
  1. 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.
  1. Choose an identifier (headers like X-Forwarded-For or User-Agent, or cookies like SessionID).
  2. 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.
  1. Select Anycast as the type.
  1. 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.
  2. Click Add Endpoint.