Using an AWS S3 Bucket with a CDN

Using an AWS S3 Bucket with a CDN

If you're hosting content in an AWS S3 bucket and want your CDN to pull from it, the CDN needs to know exactly where to look. That means pointing it at either the bucket's endpoint or the direct URL of the specific object you want cached and served. Getting the right URL in the right format up front saves you a round of troubleshooting later when files aren't loading the way you expect.

This article walks through both URL types, where to find them in the S3 console, and what to do once you have them.

What You Need  

There are two URL formats you'll be working with, and which one you use depends on whether you're pointing your CDN at the whole bucket or just a single file.

1. S3 Bucket Endpoint  

This is the base URL for your entire bucket, the root location everything else in the bucket sits under.

Format: http://[bucket_name].s3.amazonaws.com/
Example: http://202533521498.s3.ap-south-1.amazonaws.com/

Use this when you want your CDN pointed at the bucket as a whole, rather than a specific file inside it. This is the more common setup if your bucket is acting as the origin for a whole site or app's static assets.

 

Screenshot

 

2. Object URL  

Every individual file stored in the bucket, whether that's an image, a PDF, a video, anything, has its own direct URL.

Format: https://[bucket_name].s3.amazonaws.com/[object_key]
Example: https://202533521498.s3.ap-south-1.amazonaws.com/eye.jpeg

Use this when you're linking to or caching one specific file rather than the bucket as a whole. This is the format you'll reach for most often if you're embedding individual assets directly in a page or app, like a single hero image or downloadable document.

Where to Find These URLs  

Bucket Overview  

  1. Go to the S3 Console.
  2. Click on the bucket name.
  3. You’ll find the bucket endpoint in the Overview section.

Screenshot

Object Properties  

  1. Navigate to your desired object (e.g., image, PDF, etc.).
  2. Open the Properties tab.
  3. The object URL will be displayed there.

Screenshot


Allow Public Access to the Object URL
  

Having the right URL is only half the equation. If the bucket or object itself isn't publicly accessible, your CDN will get the same access error a regular visitor would. You'll need to configure the relevant permissions and access settings in S3 so the object can actually be reached at that URL.

Screenshot

This step trips people up more often than the URL formatting does. It's worth double checking your bucket policy and object-level permissions before assuming the integration itself is broken if content isn't loading.

Example  

Bucket Name: 202533521498
Object Key: eye.jpeg

Object URL:
https://202533521498.s3.ap-south-1.amazonaws.com/eye.jpeg
This is the URL you would provide to the CDN or use in your website/app.

This is the exact URL you'd hand off to your CDN configuration, or drop directly into your website or app wherever that asset needs to load from.

Screenshot

Next Steps  

Once you've got the correct URL in hand:
  1. Add it to your CDN's origin settings.
  2. Set up your cache rules and any custom domains you need on top of it.
  3. Test the setup by loading the content through your CDN endpoint rather than the raw S3 URL, to confirm everything is actually routing and caching the way you expect.
That last step matters more than it sounds like it should. A URL that works fine when you paste it into a browser directly can still fail through the CDN if permissions, region settings, or cache rules aren't lined up correctly, so always verify through the actual CDN endpoint before considering the integration done.
    • Related Articles

    • Understanding VergeCloud CDN Headers

      Intoduction When a website utilizes VergeCloud CDN for performance enhancement and security, visitor requests are directed to VergeCloud’s CDN servers instead of directly reaching the website's main server. In return, the CDN edge server sends ...
    • Using RE2 Regular Expressions

      Using RE2 Regular Expressions Introduction VergeCloud firewall rules support advanced filtering using RE2 regular expressions. These patterns help you match specific text — such as parts of URLs, headers, or query strings — to allow, block, or log ...
    • VergeCloud’s X-Cache and X-Time Headers Explained

      When VergeCloud CDN is enabled for a website, the platform automatically adds certain response headers that help developers and administrators understand how content is delivered to users. Two important headers that appear in these responses are the ...
    • Page Rules and Caching Settings for WordPress with VergeCloud CDN

      Setting Up Page Rules and Browser Caching for Your WordPress Site with VergeCloud CDN When you activate VergeCloud CDN for your WordPress site, content is cached on VergeCloud's edge servers for 30 minutes by default. However, some parts of your ...
    • Verifying Your Domain in Google Search Console Using a TXT Record

      Introduction To begin using Google Search Console, you must first confirm ownership of your domain. This verification process ensures that you have the rights to the domain you wish to manage in Search Console. This guide outlines the steps to verify ...