From 187645b4760fcc58d4d2ba3696394ef494a71b43 Mon Sep 17 00:00:00 2001 From: Khue Nguyen Date: Fri, 9 Dec 2022 15:31:59 -0800 Subject: [PATCH] chore: move server ahead of s3 group --- src/NextjsDistribution.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/NextjsDistribution.ts b/src/NextjsDistribution.ts index 3a04f95f..8afde135 100644 --- a/src/NextjsDistribution.ts +++ b/src/NextjsDistribution.ts @@ -338,8 +338,8 @@ export class NextjsDistribution extends Construct { // - if 403, fall back to lambda handler (mostly for /) // - if 404, fall back to lambda handler const fallbackOriginGroup = new origins.OriginGroup({ - primaryOrigin: s3Origin, - fallbackOrigin: serverFunctionOrigin, + primaryOrigin: serverFunctionOrigin, + fallbackOrigin: s3Origin, fallbackStatusCodes: [403, 404], });