AWS Route 53 & CloudFront

Serve Jamdesk docs at a /docs subpath using AWS CloudFront and Route 53

Use Amazon CloudFront as a CDN to proxy documentation requests to Jamdesk. This guide covers setting up CloudFront with Route 53 for DNS.

Prerequisites

  • An AWS account with CloudFront and Route 53 access
  • Your domain managed in Route 53 (or ability to update DNS elsewhere)
  • Your Jamdesk subdomain (found in dashboard settings)

Step 1: Create a CloudFront Distribution

  1. Open the CloudFront console
  2. Click Create Distribution
  3. Configure the origin:
SettingValue
Origin domainYOUR_SLUG.jamdesk.app
ProtocolHTTPS only
Namejamdesk-docs-origin

Replace YOUR_SLUG with your actual Jamdesk subdomain.

Step 2: Configure Origin Settings

In the origin settings, add a custom header to identify your domain:

Header nameValue
X-Forwarded-Hostyoursite.com

This header tells Jamdesk which domain is making the request so URLs render correctly.

Step 3: Create a Cache Behavior for /docs

Add a behavior to route /docs/* requests to your Jamdesk origin:

  1. Go to the Behaviors tab
  2. Click Create Behavior
  3. Configure:
SettingValue
Path pattern/docs/*
Originjamdesk-docs-origin
Viewer protocol policyRedirect HTTP to HTTPS
Cache policyCachingOptimized
Origin request policyAllViewerExceptHostHeader

The AllViewerExceptHostHeader policy is required. It forwards all headers except Host, allowing Jamdesk to receive the necessary request information.

Step 4: Add Alternate Domain Name

  1. In the General tab, click Edit
  2. Under Alternate domain name (CNAME), add yoursite.com
  3. Select or request an SSL certificate for your domain

Step 5: Configure Route 53

Create an alias record pointing to your CloudFront distribution:

  1. Open the Route 53 console
  2. Select your hosted zone
  3. Click Create Record
  4. Configure:
SettingValue
Record nameyoursite.com (or leave blank for apex)
Record typeA
AliasYes
Route traffic toCloudFront distribution
DistributionSelect your distribution

Step 6: Verify

After DNS propagation (usually 5-15 minutes), visit https://yoursite.com/docs to confirm your documentation loads correctly.

Complete CloudFront Configuration Summary

Distribution Settings:
├── Origin: YOUR_SLUG.jamdesk.app
│   └── Custom Header: X-Forwarded-Host = yoursite.com
├── Behavior: /docs/*
│   ├── Cache Policy: CachingOptimized
│   └── Origin Request Policy: AllViewerExceptHostHeader
└── Alternate Domain: yoursite.com (with SSL certificate)

Troubleshooting

Ensure the origin domain is exactly YOUR_SLUG.jamdesk.app without https:// prefix.

Verify the Viewer protocol policy is set to "Redirect HTTP to HTTPS" and your SSL certificate is valid.

Create a CloudFront invalidation for /docs/* to clear cached content after publishing changes.

What's Next?

Vercel

Alternative: Use Vercel rewrites

All Options

Back to overview