Question

upstream timed out (110: Connection timed out) while reading response header from upstream

Posted September 28, 2021 369 views
NginxMongoDBNode.jsDigitalOceanLet's Encrypt

Hi all,
After successful deploying MERN stack app into the DO,
I got 504 Gateway Time-out issue and I checked server error logs here(/var/log/nginx/error.log)

2021/09/28 16:33:18 [error] 1252#1252: *6 upstream timed out (110: Connection timed out) while reading response header from upstream, client: x.x.x.x, server: _, request: "POST /api/users/login HTTP/1.1", upstream: "http://127.0.0.1:5000/api/users/login", host: "x.x.x.x", referrer: "http://x.x.x.x/signin"

Any suggestions on how to solve this issue?
Thanks

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.

×
Submit an Answer
1 answer

Hi @axiom88guru,

So far in my experience, such errors have always been from the Application side rather than NGINX. Check your Application, I can guarantee there will be a misconfiguration somewhere on it rather than with NGINX.

Other than that, I can’t give more suggestions just because I’m not sure what your setup is or the configuration of the app.

  • Hi @KFSys, thanks for replying.
    In terms of this application, it was working like charm before I destroy old server and created a new droplet and deployed source again.

    Like you mentioned, it might be misconfiguration somewhere but its really hard to find whats going on with my server.

  • Problem solved. Yes, it was my configuration problem. Thanks @KFSys

    • Hi @axiom88guru,

      I’m glad to hear you were able to resolve the issue on your own!

      Can you please share if it was something specific you missed or just a small typo?

      I’m asking in case other people find this question helpful.

      • Hi @KFSys, thanks for connecting.

        The problem was solved because it was just a small typo issue.
        MONGO_URI=mongodb://localhost:27017/boat-camp"
        Please note that the URL above has “ at the end and that leads to a problem.
        Hope other people find this answer helpful.

        Regards,