Sites not opening or are very slow after deploying nginx before Apache

Cool Buddy

Wise Old Owl
I have a VPS with Contabo. Currently using their cheapest option which offers 2 vCPU cores and 4 GB of RAM.

I am running NextCloud, Piwigo, and BookStack on it. Since I'm the only user, and I use only one service at a time (max 2 if any NC Sync is running). I had configured all of these services using Apache and they were running fine, slow, but fine. All this is for learning purposes and I'm not actually using any of these services in real life right now, just doing test runs.

So I have been trying to run Code-server and Seatable on it, but they require nginx. So despite now knowing anything about nginx, I finally took a dip and over the last two days, I put Apache behind nginx.

I managed to successfully configure everything and all the services are running. However, they are much slower now and most of the time I keep getting 504 Gateway timeout error. The sites load only after trying 3-4 times.

Just some additional info which may or may not be relevant. I have added letsencrypt certificates using certbot and I changed the config properly so that encryption is now being handled by nginx and not Apache. I have also configured Apache on port 9000. When idling, webmin dashboard shows CPU usage at 2% and RAM usage at ~20%.

Would appreciate any help in figuring out what's gone wrong.
 

thetechfreak

Legend Never Ends
Hard to say like this. Slow down can be anywhere. Can you do a trace route and show the results? It'll help us understand if it's a network related lag.

Sent via Tapatalk
 
OP
Cool Buddy

Cool Buddy

Wise Old Owl
For anyone who stumbles upon this later on:

I finally figured that it was the VPS itself which was ridiculously slow. I had taken an HDD based VPS for cost reasons. After this, I was forced to upgrade to an SSD based VPS. I did the same configuration on this new VPS and it ran fine. So there was no issue with Apache, Nginx, or the configurations.
 
Top Bottom