From 7c515dc3ff8dbefb6cf086cc67d677ae3c421162 Mon Sep 17 00:00:00 2001 From: Daniel Beardsley Date: Mon, 4 Sep 2023 11:22:42 -0700 Subject: [PATCH] Vercel Proxying: add config to test proxying We'd like to try experimenting with pointing www.ifixit.com at vercel and have vercel proxy any missed routes to our main php app. Before we make changes at the CDN level, let's set up this rewrite to do some experimentation. --- frontend/next.config.js | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/frontend/next.config.js b/frontend/next.config.js index 442aaf0e..7984df04 100644 --- a/frontend/next.config.js +++ b/frontend/next.config.js @@ -77,12 +77,20 @@ const moduleExports = { ]; }, async rewrites() { - return [ - { - source: '/uploads/:name', - destination: `${strapiOrigin}/uploads/:name`, - }, - ]; + return { + afterFiles: [ + { + source: '/uploads/:name', + destination: `${strapiOrigin}/uploads/:name`, + }, + ], + fallback: [ + { + source: '/:path*', + destination: `https://proxy.ifixit.com/:path*`, + }, + ], + }; }, async redirects() { return [