400 bad request in production after upgrading to 14.0.2 (and after)
Answered
Barbary Lion posted this in #help-forum
Barbary LionOP
In the logs it's showing
For context: This is running behind nginx, in a docker container, on a custom domain. It fails ONLY in production. I did put
It works fine if I run the docker image locally.
After some debugging we discovered that this issue only occurs on routes that go through the middleware.
I have basically tried any solution that I could find on Google/stackoverflow already.
ERR_INVALID_URL with an input of something like "/favicon.ico" (instead of the full URL).For context: This is running behind nginx, in a docker container, on a custom domain. It fails ONLY in production. I did put
ENV HOSTNAME "0.0.0.0" in the dockerfile already.It works fine if I run the docker image locally.
After some debugging we discovered that this issue only occurs on routes that go through the middleware.
I have basically tried any solution that I could find on Google/stackoverflow already.
Answered by Barbary Lion
Has been fixed.
The issue was that I was accidentally setting
The issue was that I was accidentally setting
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; twice in my Nginx config. That it only broke with this version and upwards, is most likely related to [#57815](https://github.com/vercel/next.js/pull/57815) .1 Reply
Barbary LionOP
Has been fixed.
The issue was that I was accidentally setting
The issue was that I was accidentally setting
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; twice in my Nginx config. That it only broke with this version and upwards, is most likely related to [#57815](https://github.com/vercel/next.js/pull/57815) .Answer