The endpoint given by AWS S3 after your object have uploaded is really noisy and not friendly with user's experience. So, how we can make it more friendly? In this tutorial, I will guide you the best simple magic.

Problem & Solution

Firstly, I would like to upload my image with name is 2ktest.jpgto my S3 Bucket, and after my image has uploaded successfully, I got an endpoint like this:

However, it's really noisy and not friendly with the user's experience.

My solution is I would like to change the current endpoint to my subdomain and with S3 object like this:


  • You must have a Cloudflare account and your domain must be DNS to Cloudflare's DNS was provided.
  • Prepare a subdomain for ALIAS to your S3 bucket endpoint, for example

If you haven't any experience with Cloudflare, please follow the instruction below

DNS to Cloudflare

  1. Setup a Cloudflare and enter your domain name for setup.
  2. Go to your domain name's management and use custom domain name server for DNS to Cloudflare's name servers has given at the first step.

For example, I got two name servers:|

And my domain was purchased from and I would like to change my nameservers to Cloudflare's Nameservers at above.

You may want to reference from document's Namecheap for change DNS of your domain at here:

Setup S3 Bucket

For require to ALIAS a domain to your S3 bucket, you must set the name of S3 bucket equal with your domain name you want to ALIAS to it.

ALIAS Your Domain

After your domain has DNS to Cloudflare and managed by them. We would like to use DNS services to create an ALIAS domain to your s3 bucket.

Depend on your S3 Bucket's regional, we will ALIAS with difference hostname.

For example, my S3 bucket is currently hosted by Singapore regional with name ap-southest-1

We can ALIAS like this:

  1. Select CNAME
  2. Enter wildcard name is s3 (for
  3. Enter Singapore regional endpoint of the AWS S3:
  4. You may want to enable or disable the Cloudflare Proxy to your domain

That's all

Let's try to upload an object and access to it with your domain.

Thank you, if you have any question or comment please lets it at below.

AWS S3 Endpoints

Here are some endpoints you may want to copy if you don't know:

Regional Endpoint
US East(N.Virginia)
US West(N. California)
Asia Pacific(Tokyo)
US West(Oregon)

The best simple way to find your endpoint that is look up to the Object URL of your S3 object:

The original post at: