Skip to content
Discussion options

You must be logged in to vote

By default, Next.js normalizes paths by removing the trailing slash. For example, /eventsub/ is automatically redirected to /eventsub. This is why you’re seeing the redirect.

traefik.http.middlewares.es-internal-rewrite.replacepathregex.replacement=/eventsub/$$1
You are replacing it to /eventsub/ so nextjs is trying to remove the slash.

To fix this problem, update your next.config.js like this:

module.exports = {
  trailingSlash: true,
};

With this setting, Next.js will keep the trailing slash in URLs, and the redirect will no longer occur.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by gltched-usr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants