Next.js Discord

Discord Forum

Need help with hosting my Next.js website.

Unanswered
Pungsan Dog posted this in #help-forum
Open in Discord
Pungsan DogOP
Hi I've been trying to host a website as part of a freelance work(working for first time), the website is made using Next.js.

While developing i hosted it on Vercel so that the client can see how the website looks, but now I have to deploy that website and make it live and I've never worked hosted a Next.js website.

Earlier they told me they will handle the hosting and deployment job and they somehow did it but the problem was the images were not loading and kept giving me Error 502(Bad gateway Error, *see image attached) when opening the live website(they have configured the domain settings over Cloudfare). Now they have asked me to work on deploying it as they can't fix it.

So I tried

Installing Sharp to fix any problem because if Image tag.

Downsizing and compressing the images.

So I am trying to deploy it using Docker now(they tried using build files), I have created a docker image of the website and running it over port 2000 of the VPS on Hostinger. I can access the website on http://<ip-address>:2000.

Now to point my domain to the IP address of the website and the specific port, I read that I need to use reverse proxy my requests using Nginx(never worked using it), I installed it up on the VPS and made the changes suggested by the Chatgpt to configure the reverse proxy but still no success(I still see the older instance of the website running on the domain, not the docker one).

I don't know how to fix this and what is wrong, any fix, advice or solution to this will be greatly appreciated. I can provide the specifics if anyone has any idea how to get this done.

1 Reply

do you use auth0?