Next.js Discord

Discord Forum

Change "url" parameter to "link" when using next/image

Answered
Indian oil sardine posted this in #help-forum
Open in Discord
Indian oil sardineOP
Hello there,
we are using Next.js 13 with App Router running in a Docker container and using Traefik as a proxy and have encountered an issue where Traefik has the "url" keyword as a reserved keyword (or so it seems), so when next.js creates a link to a cached image that looks like this:
"/_next/image?url={LINK}",
we would need to change the "url" parameter to something different.
Can this be done somehow, maybe through next.config?

Thank you in advance for any tips!

Have a great day!
Answered by Indian oil sardine
Thank you for the message, I found out that the error was caused by next.config.js not being copied to the workdir inside Dockerfile.
So the solution is to do something like this:
WORKDIR /app
COPY next.config.js ./

In case anyone needs this.
View full answer

2 Replies

unfortunately i don't know of any way to change that and i doubt it is even possible; you probably have to [patch](https://pnpm.io/cli/patch) nextjs and edit the nextjs source directly
Indian oil sardineOP
Thank you for the message, I found out that the error was caused by next.config.js not being copied to the workdir inside Dockerfile.
So the solution is to do something like this:
WORKDIR /app
COPY next.config.js ./

In case anyone needs this.
Answer