S3 Pages
Serve a static site from an S3 bucket on your own domain, with automatic HTTPS and normal S3 pricing.
S3 Pages turns a bucket into a public site. Upload HTML, CSS, JavaScript, images, and other static files, choose an index document and an optional error document, then attach a custom domain. The edge serves the site over HTTPS and handles directory paths for you.
S3 Pages is a bucket setting, not a separate product. It uses the same bucket, objects, and access keys as the S3 API. The generated S3 endpoint stays a normal REST endpoint, while the site behavior applies to custom domains attached to the bucket.
Before you start
- A bucket with at least an index file, usually
index.html. - An active AnythingCloud account with a positive balance.
- For a custom domain, a root domain you can add TXT and CNAME records for.
You can prepare and test the bucket and files before attaching a domain. The site becomes reachable at your own address once the domain finishes setting up.
Turn on S3 Pages
- Open Object storage and choose the bucket.
- Open the Pages tab.
- Turn on Turn on S3 Pages for this bucket.
- Set the Index document. Use a single file name such as
index.html. - Optionally set an Error document such as
404.html. The error document may live in a folder, for exampleerrors/404.html. - Choose Save S3 Pages settings.
S3 Pages makes the bucket public, because a browser loads the files without a signature. Writes still require your access keys. Turning S3 Pages off does not make the bucket private; use the Access tab if you also want to stop anonymous reads.
S3 Pages is configured on the bucket's Pages tab. The S3 website
subresource is not part of the supported API, so use the console rather
than PutBucketWebsite.
Upload the site
Upload files from the bucket's Objects tab, or use any S3
client with the bucket endpoint and access keys. Relative links work
normally, so a site with this layout serves index.html at the
root and about/index.html at /about/:
index.html
404.html
about/index.html
assets/site.css
assets/app.js
images/logo.png
S3 has no real directories; a folder is a key prefix. Uploading
about/index.html creates the about/ prefix. The
console's New folder button creates the same kind of
prefix and is optional.
Files keep the content type they were uploaded with. Upload HTML as
text/html and CSS as text/css so browsers render
the site instead of downloading files. Console uploads infer common types;
S3 clients should set ContentType explicitly.
For a site that uses absolute asset paths such as
/assets/site.css, keep the files at those exact keys. The edge
does not rewrite links inside your HTML.
How paths resolve
S3 Pages serves the bucket's generated endpoint and every custom domain attached to it. Anonymous browser requests resolve paths like this:
| Request | File served |
|---|---|
/ | index.html |
/about/ | about/index.html |
/about | about/index.html when it exists |
/assets/site.css | assets/site.css |
| A missing file or folder | The error document, with status 404 |
Requests for an existing file are served as-is. A path that ends in a file extension is never treated as a folder. A path without an extension first gets the normal object lookup, then the index document fallback.
The generated endpoint at <bucket>.s3.anything-cloud.com
serves the site to anonymous browser requests. Signed and presigned S3
requests on the same endpoint keep normal REST behavior, including bucket
listings and direct object access, so SDKs and the AWS CLI continue to
work.
Error document
The error document is optional. When set, a missing page returns the error
document's bytes with HTTP status 404, which is what search
engines and browsers expect for a missing page. When left blank, the storage
gateway's normal 404 NoSuchKey response is returned.
The error document is only used for missing objects. Errors from your own HTML or JavaScript are not intercepted, and the edge's own 5xx, 429, and request-size responses keep their normal error pages.
Keep the error document self-contained, or use absolute paths for its assets. A relative path is resolved from the URL that failed, not from the error document's folder.
Attach a custom domain
The generated endpoint works without a custom domain. To serve the site at your own address, open the Pages tab and choose Add a custom domain. It opens Networking → Hosts with the bucket already selected. The full setup has three parts:
- Verify the root domain. Add the TXT record shown by the
wizard at
_anythingcloud.example.com, then choose Verify TXT record. - Point DNS at the edge. Add a DNS-only CNAME from the
host, or from
*.example.comfor several subdomains, toedge.anything-cloud.com. A deeper name such asassets.eu.example.comneeds a wildcard for that branch too. - Add the host. Choose the bucket, enter the subdomain,
and save. Use
@for the apex. The host shows Setting up while DNS and the certificate are checked, then Active.
Use DNS only (grey cloud) in Cloudflare. A proxied record can return Cloudflare errors 525 or 1014 during certificate issuance and can interrupt large uploads.
The Pages tab lists the bucket's custom hosts and their status. The site address appears there as soon as a host is active. See Custom domains for the full DNS and status reference.
Apex and www
Both the apex (example.com) and www.example.com
can point at the same bucket. Add them as separate hosts if you want both to
work. The certificate is issued per host. A CNAME cannot normally be placed
at the apex; use your DNS provider's apex CNAME support, or point the apex at
the edge with the provider's alias record.
Cache and updates
Bucket hosts use the edge cache. The default keeps a successful response for five minutes. Open the host's Caching tab under Networking → Hosts to set a different lifetime for a file extension, from five minutes to one year, or to keep an extension out of the cache.
Uploading through the console updates the bucket version, which invalidates the cached copies. Uploading through the S3 API does not update that version, so a replaced file can stay cached until its normal lifetime ends. If you deploy with an S3 client, use short cache lifetimes for HTML or change the files' keys (for example, add a content hash to asset names).
To force a change immediately, use Clear cache at the top of the bucket page. It invalidates the cached copies for the generated endpoint and every custom domain attached to that bucket, without affecting any other bucket. The same action is on a bucket host's Caching tab in Networking. The edge applies the change on its next pass, which can take a few minutes. Clearing the cache does not delete files.
Pricing
S3 Pages has no separate charge. The bucket uses the normal object-storage prices:
| Usage | Price |
|---|---|
| Storage | $0.023 per GB-month on pay as you go |
| GET, HEAD, and other reads | $0.0004 per 1,000 requests |
| PUT, POST, PATCH, and copy writes | $0.005 per 1,000 requests |
| DELETE | Free |
| Data transfer to the internet | First 100 GB free each month, then $0.09 per GB |
Monthly storage plans cover storage only; requests and data transfer are billed at the rates above. Cached responses still count as requests and still transfer bytes to the visitor. See Billing and metrics for the full model.
Limits
| Item | Value |
|---|---|
| Content | Static files only; S3 Pages does not run server-side code. |
| Index document | A single file name, up to 255 characters, such as index.html |
| Error document | An object key, optionally in a folder, such as errors/404.html |
| Custom hosts | Domains attached to the bucket, subject to the normal hostname limit |
| Redirects and routing rules | Not supported; use client-side routing or separate objects |
| Custom response headers | Not configurable per bucket; set object metadata when uploading |
Troubleshooting
| Symptom | Check |
|---|---|
| The custom host is stuck on Setting up | The CNAME must resolve to the edge and be DNS-only. Open the host in Networking to see the reported error. |
403 AccessDenied | S3 Pages is off or the bucket was made private. Turn S3 Pages on again from the Pages tab. |
| The site root shows a file listing or an S3 error | Check that the index document exists and that S3 Pages is on. Signed S3 requests intentionally keep REST behavior; use a normal browser request for the site. |
| The error document does not appear | Check the error document key and the host status. A blank error document returns the storage gateway's default response. |
| An old page is still shown | Wait for the cache lifetime, or replace the file through the console. Check the host's cache rules. |
| HTML downloads instead of rendering | Re-upload the file with Content-Type: text/html. |
Related guides
- Buckets for names, uploads, folders, versioning, and limits.
- S3 API for endpoints, credentials, SDKs, and presigned URLs.
- Custom domains for TXT verification, CNAME records, statuses, and cache rules.
- Billing and metrics for storage, request, and transfer charges.