disjukr / next-rewrites-test

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Next Rewrites Test

This repository is intended to verify that the host header is properly passed when reverse proxying another web server in a Next.js project.

This repository consists of three projects:

  • edge-middleware - This project uses the edge middleware feature to return the content from localhost:4000/foo when accessed via localhost:3000/foo.
  • nextjs-rewrites - This project accomplishes the same task as the above using the rewrites feature of the Next.js config.
  • rewrite-target - This project provides an API at localhost:4000/foo that returns whatever host header it receives.

How to run

pnpm install
pnpm dev:edge-middleware # or pnpm dev:nextjs-rewrites
open http://localhost:3000/foo

About


Languages

Language:TypeScript 78.6%Language:JavaScript 21.4%