Hi, I have some troubles with my application I am using docker-compose and I have 2 backend node.js apps and 1 react fe. Part of docker-compose is nginx. After start everything works fine, but in a while (sometimes hours, sometimes minutes) ngnix starts to return error - “*426 upstream timed out (110: Connection timed out) while reading response header from upstream” The weird part is that on other Droplet everything works fine
upstream fe-wpos {
server fe-wpos:3000;
}
upstream be-wpos {
server be-wpos:5000;
}
upstream be-rs-wpos {
server be-rs-wpos:8081;
}
server {
listen 80;
location / {
proxy_pass http://fe-wpos;
}
}
server {
listen 5000;
location / {
proxy_pass http://be-wpos;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
server {
listen 8081;
location / {
proxy_pass http://be-rs-wpos;
}
}
I have no idea what is wrong
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Hi there,
As the services are working for some time before you get the error, this makes me think that the problem is not related to your docker-compose YAML.
Most likely one of the services is crashing due to an error or due to not enough memory on the server for example.
I would recommend, checking your Docker container logs for some more information.
You could find the logs for a specific container with the following:
In there you should be able to see any application errors that pop up. If you don’t see any logs, you might have to enable debug mode and try again.
Let me know how it goes! Best, Bobby