I have my backend in France and one of my frontend servers is in Japan. This issue doesn't happen with any other of my frontends, only this Japan server, which already has about 2s latency from most locations.
The latency isn't what's bothering me, it's timeout errors that occur on the frontend. I am certain this is not a backend problem since this only happens with the Japan server, and occurs when fetching static resources such as images, so it's not an issue with php-fpm, which I'm using.
I also get these errors sometimes:
upstream prematurely closed connection while reading response header from upstream
It is not a memory or CPU issue either. nginx on the frontend is using 4 worker processes and
proxy_read_timeout is set to 150, even though changing it doesn't make a difference.
Is there any things you recommend I do to fix these errors?