Next.js Discord

Discord Forum

cors problem

Unanswered
gref9730 posted this in #help-forum
Open in Discord
Avatar
Hello I have a next js application

its running on custom linux server as localhost:3000

and im running nginx server which listens on port 80 and pass anyone to the localhost:3000 so the next js application is reachable ... it works and is accesible ...

the problem is that im getting cors error since I have most of the frontend fetches made as

process.env.NEXT_PUBLIC_URL

which I in development used to have as "localhost:3000"

and now I changed it to the actual domain url which im hosting the server on ...

which is "example.com" ... but now with this example im getting cors erros and none of the fetches goes thru...

how to set it up so it works?

0 Replies