User menu
    • SnapiX About
    • SnapiX API Reference
    • SnapiX MCP Reference
    • SnapiX SDK Reference
    • SnapiX Plans
AU
By using this site you accept the terms of use, privacy policy and cookie policy.
App logo
Cover image
Published by Spas Z. Spasov. Last edit by Spas Z. Spasov on September 27, 2025

Using AWS S3 Virtual Hosting on the Web

At­tach­ing FQDN to AWS S3 Buck­et. This ap­proach only sup­port HTTP and does not sup­port HTTPS.

Yes, it is pos­si­ble to at­tach a Ful­ly Qual­i­fied Do­main Name (FQDN) to an AWS S3 buck­et, sim­i­lar to what you might do with Cloud­flare R2. This process is known as "vir­tu­al host­ing" for S3 buck­ets. Here's how you can set it up:

  1. Cre­ate an S3 buck­et: The buck­et name must ex­act­ly match the FQDN you want to use. For ex­am­ple, if you want to use bucket.example.com, your buck­et name should be bucket.example.com.

  2. Con­fig­ure the buck­et for sta­t­ic web­site host­ing: En­able sta­t­ic web­site host­ing in the buck­et's prop­er­ties and set up your in­dex and er­ror doc­u­ments.

  3. Set up DNS: Cre­ate a CNAME record in your DNS set­tings that points your do­main to the S3 web­site end­point. The end­point for­mat is typ­i­cal­ly: <bucket-name>.s3-website-<region>.amazonaws.com.

    For ex­am­ple, if you're us­ing the Eu­rope (Frank­furt) re­gion (eu-central-1), your CNAME record should look like this:

    Type: CNAME
    Name/Host: bucket.example.com
    Value/Target: bucket.example.com.s3-website.eu-central-1.amazonaws.com
    TTL: 3600 (or as preferred)
    

    This will al­low you to ac­cess your con­tent via http://bucket.example.com. Note that https:// ac­cess will not be avail­able.

    A bit bet­ter ap­proach is to use di­rect­ly the Ama­zon S3 reg­u­lar end­point rel­e­vant to your re­gion. So ac­cord­ing the above ex­am­ple your CNAME record should look like this:

    Type: CNAME
    Name/Host: bucket.example.com
    Value/Target: s3.eu-central-1.amazonaws.com
    TTL: 3600 (or as preferred)
    

    This al­lows you to ac­cess your buck­et's con­tent via https://bucket.example.com in an in­se­cure way. How­ev­er, it may be suf­fi­cient for your web app to load files with­out run­ning into CORS is­sues caused by HTTPS-to-HTTP re­quests. Note that in this set­up, ac­cess­ing the root URL di­rect­ly will re­sult in an Ac­cess­De­nied er­ror - even if index.html is present. There­fore, you must spec­i­fy the full path to the file, such as https://bucket.example.com/index.html.

  4. Up­date buck­et pol­i­cy: En­sure your buck­et pol­i­cy al­lows pub­lic read ac­cess to the ob­jects if you're host­ing a pub­lic web­site.

  5. Up­load your con­tent: Add your files to the S3 buck­et.

Im­por­tant con­sid­er­a­tions:

  • This method works well for sub­do­mains (like bucket.example.com) but for root do­mains (example.com), you'll need to use Ama­zon Route 53 as your DNS provider.

  • S3 web­site end­points don't sup­port HTTPS by de­fault. If you need HTTPS, you should use Ama­zon Cloud­Front in front of your S3 buck­et. Al­ways fol­low se­cu­ri­ty best prac­tices when set­ting up buck­et poli­cies.

  • If you're us­ing Cloud­flare as your DNS provider, you can en­able the Prox­ied op­tion to make HTTPS con­nec­tions avail­able.

For more in­for­ma­tion, you can re­fer to the AWS doc­u­men­ta­tion on Web­site End­points and Get­ting Start­ed with S3.