Skip to content

Commit

Permalink
Vercel Proxying: add config to test proxying
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
danielbeardsley committed Sep 4, 2023
1 parent 0870b75 commit 7c515dc
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions frontend/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 [
Expand Down

0 comments on commit 7c515dc

Please sign in to comment.