• Register
0 votes

Problem :

Currently I am using the nginx and node server to serve the update requests. I often face the gateway timeout whenever I request an update on large data. I saw below error from the nginx error logs as below :

2019/04/07 00:46:04 [error] 28599#0: *1 upstream prematurely closed connection while reading response header from upstream, client:, server: gis.oneconcern.com, request: "GET /update_mbtiles/atlas19891018000415 HTTP/1.1", upstream: "", host: "gis.oneconcern.com"

I tried everything that I could, but I still I face the same error.

The nginx configuration has below proxy settings :


    # Proxy settings


    proxy_connect_timeout 1000;

    proxy_send_timeout 1000;

    proxy_read_timeout 1000;

    send_timeout 1000;


I am trying to use the nodejs backend to serve the requests on an aws server. My gateway error shows up only when a update takes the long time around 3-4 minutes. Please note I do not get the error for smaller updates. Please let me know how can I resolve the issue.

6 5 3
7,540 points

Please log in or register to answer this question.

1 Answer

0 votes

Solution :

I also had the same error for quite a while in recent past, and below is what fixed it for me.

I just declared in service that i use what is given below :

Description= The node service description

After= network.target






WorkingDirectory=/path/to/your /node/app/root/directory

ExecStart=/path/to/your/node /path/to/server.js



Please note "After=network.target". I spent many days looking for the fixes on nginx side, while my problem was just that. To be very sure just stop running the node service you have and  launch the ExecStart command directly and try to just reproduce the bug. If it does not show up, it clearly means that your service has all the problems. This is how I found my answer.

9 7 4
38,600 points

Related questions

0 votes
1 answer 825 views
Problem : My Environment is Nginx + uwsgi and I am very new to it. I am getting a 502 bad gateway error from Nginx on certain GET requests. It seems to be related to a length of URL.. Please find below the nginx/error.log [error] 22113#0: *1 recv ... response header from upstream, client:, server: server.domain.com, request: "GET <long_url_here>" Can somebody solve this issue?
asked Nov 27, 2019 alecxe 7.5k points
0 votes
1 answer 393 views
Problem : I want to set up the hello world example with AWS lambda and serving it through the api gateway. I clicked a "Create a Lambda Function", which set up a api gatway and selected a Blank Function option. I added a lambda function found on AWS ... response { "message": "Internal server error" }. And my logs say "Execution failed due to configuration error: Malformed Lambda proxy response".
asked Jan 22, 2020 jwilliam 3.9k points
0 votes
1 answer 1.6K views
Problem : I had recently uninstalled the Postgres10 and after that reinstalled the Postgres10. After that I went to run a Node, Express, React application that relies on connecting to a Postgres10 database and also communicates with it using Sequelize. Initially I was unable to ... app at in the browser. Does anyone have any idea what is going wrong? Please suggest me the solution for my error.
asked Nov 22, 2019 peterlaw 6.9k points
1 vote
1 answer 543 views
Problem: I am very new to node so I think I am making something extremely wrong here as I am unable to find any info at all by doing research online. I already have the django site and I required the JS charting library so I chose the chart.js. I have ... build a chart. Failed to create chart: can't acquire context from the given item . Please help me in fixing above NodeJs elated error.
asked Jun 4, 2020 Martin K 6.6k points
0 votes
2 answers 2K views
Problem : Currently I am using VueJS and Laravel for the project. Following issue started to show lately and it also comes up even in the old git branches. Unchecked runtime.lasterror: the message port closed before a response was received. This error only comes up in Chrome browser.
asked Dec 10, 2019 alecxe 7.5k points
0 votes
1 answer 19 views
Problem: I am very new to cordova, phonegap, ant,sdk,jdk. I am learning to use phonegap/cordova. Everything is installed properly on my machine i.e cordova, phonegap, ant,sdk,jdk. But now suddenly it started saying that: "&rsquo;Node' is not recognized as an ... insufficient knowledge I am unable to fix this issue. I am looking for cordova and phonegap experts who can help me in fixing this issue.
asked Sep 2, 2020 Raphael Pacheco 4.9k points
0 votes
1 answer 66 views
Problem: I am very desperately trying to install the modules using node.js but it always fails while getting the packages with npm. I was logged in as Administrator and then used powershell/cmd with a "run as administrator". I also had problems with a registry so I ... error: Npm ERR! Please try running this command again as root/Administrator. Can someone help me in fixing my above NPM error.
asked Aug 31, 2020 Raphael Pacheco 4.9k points
0 votes
1 answer 23 views
Problem: I am a beginner to node.js, cordova and npm.When I try below command: $ npm install -g cordova@latest I always face below error: &ldquo;Npm WARN deprecated node-uuid@1.4.8: Use uuid module instead.&rdquo; Below are my system details: mac Os Sierra 10.12 ... each and every suggestion and also tried to install or uninstall the hundred times. I want to know is it a npm or cordova problem?
asked Aug 29, 2020 Raphael Pacheco 4.9k points
0 votes
1 answer 108 views
0 votes
1 answer 172 views