Im currently deploying my Next JS 14.1.4 on to a cPanel server using Custom Server method.
For context, I just migrated the server from Cent OS 7 to AlmaLinux 8, node v16 to v20, Next 13 to 14.
I have 3 Next App running on the server, both Next 13 and 14. The 3rd Next 14 app returns 400 Bad Request when trying to access it by domain. However, when I access using direct server IP (Host File method), it works. This happened only after server migration, before migration it was working well without issues.
The app includes Clerk Auth & Socket IO, while other app don’t.
My question here is, what is going on? Why does it work only on IP and not on domain? And why does other Next app work normally on a domain but not this specific one?
If we say its because of auth or socket, both still works on IP. I can still login with clerk when I access the page using IP.
If we say its related to DNS or proxy, my other next app, which is configured similarly, still works even after migration. Why does this 3rd Next app return 400 Bad Requests?
My other question is, how do I log the 400 Bad Request? I wanted to know what is causing it. But I can’t find a way to do so with the cPanel server
Code: https://github.com/DanishNasarudin/idt-intapp