Skip to content

Commit

Permalink
Add custom error responses to fix single page apps
Browse files Browse the repository at this point in the history
  • Loading branch information
zackbloom committed Apr 29, 2015
1 parent 6088a68 commit 2634d82
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,21 @@ func GetDistribution(options Options) (dist cloudfront.DistributionSummary, err
MinimumProtocolVersion: "TLSv1",
SSLSupportMethod: "sni-only",
},
CustomErrorResponses: cloudfront.CustomErrorResponses{
// This adds support for single-page apps
cloudfront.CustomErrorResponse{
ErrorCode: 403,
ResponsePagePath: "/index.html",
ResponseCode: 200,
ErrorCachingMinTTL: 60,
},
cloudfront.CustomErrorResponse{
ErrorCode: 404,
ResponsePagePath: "/index.html",
ResponseCode: 200,
ErrorCachingMinTTL: 60,
},
},
Aliases: cloudfront.Aliases{
options.Bucket,
},
Expand Down

0 comments on commit 2634d82

Please sign in to comment.