Skip to content

Fix: Update Vercel rewrites proxy#6831

Merged
MarconLP merged 2 commits into
masterfrom
update-vercel-rewrites
Nov 6, 2023
Merged

Fix: Update Vercel rewrites proxy#6831
MarconLP merged 2 commits into
masterfrom
update-vercel-rewrites

Conversation

@ivanagas

Copy link
Copy Markdown
Contributor

Changes

Vercel uses :path* and added note that it might not work for all frameworks.

Tested on https://nextjs-test-ten-cyan.vercel.app/

@ivanagas
ivanagas requested a review from MarconLP September 26, 2023 23:08
@vercel

vercel Bot commented Sep 26, 2023

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
posthog ✅ Ready (Inspect) Visit Preview Nov 3, 2023 4:48pm

@ivanagas

Copy link
Copy Markdown
Contributor Author

Looking into it some more:

  • Works with Next.js pages router
  • Doesn't work with T3 app, even if you remove NextAuth and tRPC.
  • A way to check is if going to domain/ingest redirects to domain/login?next=/

@MarconLP

MarconLP commented Nov 1, 2023

Copy link
Copy Markdown
Member

Can we get a warning that only specific frameworks support vercel rewrites and a list of a few popular examples that work and don't work?

@MarconLP

MarconLP commented Nov 3, 2023

Copy link
Copy Markdown
Member

Can we get a warning that only specific frameworks support vercel rewrites and a list of a few popular examples that work and don't work?

Nvm there is already a warning

"source": "/ingest/:match*",
"destination": "https://app.posthog.com/:match*"
"source": "/ingest/:path*",
"destination": "https://app.posthog.com/:path*"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might want to recommend this to use the following source: "source": "/ingest/:path(.*)", because it seems to fix the issue when using SvelteKit (question)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I'll add this.

@MarconLP MarconLP left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@MarconLP
MarconLP merged commit e1221e8 into master Nov 6, 2023
@MarconLP
MarconLP deleted the update-vercel-rewrites branch November 6, 2023 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Vercel reverse proxy not working

2 participants