Skip to content
natan307 edited this page Nov 16, 2026 · 1 revision

CDN

By default players download the pack from PackLoader's built-in web server. If you cannot open a port, or want faster downloads, serve the pack from a CDN or any web host instead.

cdn:
  mode: none          # none | url | upload
  public-url: "https://cdn.example.com/packs/{file}"
  upload-url: "https://storage.example.com/packs/{file}"
  upload-method: PUT  # PUT | POST
  upload-headers:
    AccessKey: "your-storage-api-key"

Modes

none (default)

The built-in server is used.

url

Players download from public-url. You upload plugins/PackLoader/generated/pack-<sha1>.zip to that address yourself. PackLoader does not check that the file exists.

upload

After every successful build, PackLoader uploads the pack to upload-url with an HTTP PUT (or POST) request and the headers from upload-headers. Players download from public-url.

If the upload fails (network error or a non-2xx response), PackLoader logs a warning and falls back to the built-in server, so players still get a pack.

Placeholders

Placeholder Value
{hash} SHA-1 of the pack (40 hex characters)
{file} File name, pack-<sha1>.zip

Use one of them in the URLs. Every pack version then has its own address, so CDN caches never serve an outdated pack.

public-url: "https://cdn.example.com/packs/{file}"
upload-url: "https://storage.example.com/packs/{file}"

Examples

The request is a plain HTTP upload of the zip with Content-Type: application/zip, so it works with services that accept a raw PUT:

  • Bunny Storage: upload-url: https://storage.bunnycdn.com/<zone>/{file}, header AccessKey: <password>, public-url = your pull-zone URL + /{file}.
  • WebDAV: upload-url = the WebDAV file URL, header Authorization: Basic <base64 user:pass>.
  • S3 / R2 with pre-signed URLs: pre-signed URLs expire and cannot contain {hash} signed in advance, so they are not suitable for automatic uploads. Use a service that accepts a static API key header, or put a small upload endpoint in front.
  • Your own server: any endpoint that accepts PUT and serves the file afterwards.

Service-specific details change; check your provider's documentation for the exact upload URL and authentication.

Security

  • Uploads run on a background thread and the server is never blocked.
  • upload-url and upload-headers are hidden in /packloader diag.
  • Keep config.yml private; it contains your API key in plain text.
  • Use HTTPS URLs for the CDN. Minecraft clients download from whatever public-url you give.

Checking

After /packloader reload the console shows either Pack uploaded to CDN (HTTP 201 ...) or a warning with the reason for the fallback. /packloader url prints the URL players use.

Clone this wiki locally