Welcome to the new Zamblek — and the new Sngine website - The new Zamblek website is live — and with it, a new home for Sngine, your licenses, support, and the entire ecosystem. Mehr erfahren
What’s New with v4.5! - Sngine v4.5 comes with a lot of new features Mehr erfahren
Sngine 4.5 Release! - Our Sngine team is so pleased to announce the release of Sngine 4.5! With some improvements, Mehr erfahren

How to Configure CORS on DigitalOcean Spaces?

To configure CORS on DigitalOcean Spaces and make it publicly accessible, you can set up permissions

Zamblek Zamblek 2 Min. Lesezeit
Inhaltsverzeichnis
How to Configure CORS on DigitalOcean Spaces?

To configure CORS on DigitalOcean Spaces and make it publicly accessible, you can set up permissions through the DigitalOcean control panel or use the DigitalOcean CLI. Here’s how to configure it:

1. Enable Public Access

To make your Space public:

  1. Go to the DigitalOcean Control Panel and navigate to Spaces.
  2. Select the Space you want to make public.
  3. Click on Settings.
  4. In the Permissions section, set File Listing to “Public.”
  5. Confirm by clicking Save.

This will make all objects in the Space accessible via a public URL.

2. Configure CORS Settings

You can define CORS rules directly in the Space’s settings:

  1. Go to Settings for your Space.
  2. Scroll down to CORS Configuration and click Edit CORS.
  3. Define the CORS configuration rules in JSON format. Here’s an example configuration to allow cross-origin access from any origin:

    [
    {
    "AllowedHeaders": ["*"],
    "AllowedMethods": ["GET", "POST", "HEAD"],
    "AllowedOrigins": ["*"],
    "ExposeHeaders": [],
    "MaxAgeSeconds": 3000
    }
    ]

    • AllowedHeaders: Specify headers allowed in requests. Use "*" to allow all headers.
    • AllowedMethods: Define HTTP methods like GET, POST, HEAD.
    • AllowedOrigins: Use "*" to allow requests from any origin, or specify specific domains.
    • ExposeHeaders: Specify headers exposed to the client.
    • MaxAgeSeconds: Defines how long the browser caches the CORS response.
  4. Click Save to apply your CORS settings.

Now, your DigitalOcean Space will allow public access and permit cross-origin requests.

That’s it.

Happy Sngine 🙂

Buy Sngine or Extend your support: https://bit.ly/BuySngine