Skip to content

Conflict with custom server and redirects and rewrites feature #25460

@aralroca

Description

@aralroca

What version of Next.js are you using?

10.2.2

What version of Node.js are you using?

14.15.5

What browser are you using?

Chrome

What operating system are you using?

macOS

How are you deploying your application?

Kubernetes with Docker

Describe the Bug

As I commented here, looks that something is wrong with my project using custom server together with redirects feature (neither with rewrites). The redirects are not applied, blocking the possibility to do a proper gradually migration from custom server to these new features.

Expected Behavior

rewrites and redirects would work together with custom server to be able to do a proper gradually migration.

To Reproduce

I created a repo with the reproduction:

https://github.com/aralroca/nextjs-reproducible-issue-custom-server-with-redirects-feature/

  • git clone [email protected]:aralroca/nextjs-reproducible-issue-custom-server-with-redirects-feature.git
  • cd nextjs-reproducible-issue-custom-server-with-redirects-feature
  • npm install && npm run dev
  • Check redirects:
    • curl -I http://localhost:3000/es/example/ expected: 308 to / - current status: 404.
    • curl -I http://localhost:3000/en/example/ expected: 308 to / - current status: 404.
    • curl -I http://localhost:3000/example/ expected: 308 to / - current status: 404.
    • curl -I http://localhost:3000/example expected: 308 to / - current status: 308 to /example/.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue was opened via the bug report template.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions