https://github.com/disjukr/next-rewrites-test
https://github.com/disjukr/next-rewrites-test
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/disjukr/next-rewrites-test
- Owner: disjukr
- Created: 2024-04-20T08:42:48.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-20T08:44:11.000Z (about 1 year ago)
- Last Synced: 2025-01-26T15:23:10.439Z (4 months ago)
- Language: TypeScript
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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](https://nextjs.org/docs/app/building-your-application/routing/middleware) 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.](https://nextjs.org/docs/pages/api-reference/next-config-js/rewrites)
- `rewrite-target` - This project provides an API at `localhost:4000/foo` that returns whatever host header it receives.## How to run
```sh
pnpm install
pnpm dev:edge-middleware # or pnpm dev:nextjs-rewrites
open http://localhost:3000/foo
```