Next.js Discord

Discord Forum

Redirect to subdomain results in page not found

Sokoke posted this in #help-forum
Open in Discord
I've created a login form on http://auth.example.local and after logging in I redirect the user to http://customer.example.local/dashboard. However when I arrive at http://customer.example.local/dashboard I get a 404. I redirect use router.push().

I've got two Next instances running http://auth.example.local runs on localhost:3000 and http://customer.example.local runs on localhost:3001. I've added both domains to my /etc/hosts and created proxies with nginx.

When I directly enter http://customer.example.local/dashboard into a new tab, the page shows up fine. When I resave the /dashboard/page.js the file is reloaded and shown.

Any thoughts why this happens and how to solve this?

0 Replies