Next.js Discord

Discord Forum

Cloudflare 502 return after project refresh

Unanswered
Giant Angora posted this in #help-forum
Open in Discord
Giant AngoraOP
Hello

31 Replies

Giant AngoraOP
I runned production server on my vps
And domain rewrites and proxy are by cloudflare
But sometimes when i refresh page , it return 502 , and when i refresh again , it will show website
What's its problem?
As i have an interval of getting user spotify connection , now its facing 502 and wont fetch that
Any ideas??
Also i got a hint
I splitted api connection to one FastAPI with an subdomain
And another next.js api routes , it successfully do calls to FastAPI but it wont do calls to next.js api through vps
And after a minute , it start calling but returning 502 and 504 and when i refresh page , it return 502 soundcloud
@Anay-208 | Ping in replies
Original message was deleted
Giant AngoraOP
Where are you hosting the app
Giant AngoraOP
Someone mentioned about this
@Anay-208 | Ping in replies Where are you hosting the app
Giant AngoraOP
On Windows server
@West African Lion Hi, this is new the post and you can help him
@Giant Angora On Windows server
Have you opened the port in your firewall
I won't be able to help with this since I've never used a windows server.
If it was Ubuntu I could've helped
@Anay-208 | Ping in replies Have you opened the port in your firewall
Giant AngoraOP
Actually it was working successfully from first
Cause i have configured all rewriting and port forwarding on server
But issues started after using next.js api routes to call pg database and getting or updating data from there
@Anay-208 | Ping in replies I won't be able to help with this since I've never used a windows server. If it was Ubuntu I could've helped
Giant AngoraOP
I have ubuntu myself , but due to big problems with linux and its structure... 😂
Actually im planning to host app on Google cloud or AWS after it getting paid
Giant AngoraOP
I got another hint
I guess its from Next api routes
Each refreshes , its calling to FastAPI routes successfully
And in first refresh , it will all Next api routes ( with some errors )
But after next refreshes , it wont call them anymore...
@Anay-208 | Ping in replies
Is there something configurations in next i didn't do?
I really won't be able to help since I haven't used a windows server
Giant AngoraOP
@West African Lion
@Giant Angora <@1204801693448146974>
Giant AngoraOP
I did some more configurations on Nginx to handle data instead of suddenly timeout :


http {

    client_max_body_size 10M;
    proxy_read_timeout 300; 
    proxy_connect_timeout 300; 
    proxy_send_timeout 300;

    server {
    other things...
Still on my pc on dev it works normally each refreshes :