Sometimes my requests take up to an entire minute to respond
I set up my backend through cloudflare a few weeks ago. I was testing the endpoints and for some reason every 5-10 requests it can take up to an entire minute for it to respond to the request. The other times it seems fine. I have it just set up through nginx and lets encrypt with certbot. If I try make a request while it is loading it usually works fine for another 5-10 attempts. This happens for both people in different countries and even from the VPS locally if I make it make a request through the domain too
I tried making requests directly to the IP/Port and it works fine, there are no random minute long delays to requests
1 Reply
I have a frontend hosted through cloudflare on the base domain too and it works fine, there are no slow responses. It is currently not on the same VPS
I have not messed with any subdomain specific settings or anything
the backend is using springboot and I have run them before without this issue
Still happening with another site hosted on the VPS ðŸ˜
I FIGURED IT OUT FUIHAEFUIEA
So I had disabled ipv6 when I set up the VPS. And in my nginx config I had
proxy_pass http://localhost:4321;
. Whenever a long request happened it would spit an error in the nginx error.log upstream: "http://[::1]:4321/"
. The issue was [::1]
. It seems to sometimes have been making an ipv6 local request... I switched it to proxy_pass http://127.0.0.1:4321;
and it seems to be working fine