Next.js Discord

Discord Forum

Wrong hostname used when using permanentRedirect

Unanswered
Lazuli Bunting posted this in #help-forum
Open in Discord
Lazuli BuntingOP
I have an issue when doing a redirect using permanentRedirect from the app folder. Instead of redirecting using the website url (https://example.com) it uses an internal hostname/port (http://8f82bffa7203:3000/). Any ideas where that could come from?

2 Replies

Lazuli BuntingOP
we use nginx in front of nextjs server with a reverse proxy:

location / {
proxy_buffers 8 16k;
proxy_buffer_size 16k;
proxy_pass http://hostname:3000;
proxy_set_header Host $host;
proxy_set_header Accept-Encoding "";
proxy_set_header X-Real-IP $remote_addr;
}
Lazuli BuntingOP