Question

Nginx: upstream prematurely closed connection while reading response header from upstream

  • Posted on December 12, 2013
  • hnAsked by hn

Hello,

I followed tutorial(https://www.digitalocean.com/community/articles/how-to-install-rails-and-nginx-with-passenger-on-ubuntu) to set up my Rails App(nginx 1.4.4, passenger 4.0 and mysql) on DigitalOcean’s 512MB RAM and 20GB Disk server. I got below error once I started Nginx and visit my App.

– I checked /opt/nginx/logs/error.log, which shows “1 upstream prematurely closed connection while reading response header from upstream” at the latest line.

Is this a performance issue on DigitalOcean’s 512MB RAM server? anyone know how to fix this? Thanks!

Show comments

Submit an answer

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!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

It was the same for me in Rails 4, but I have added a SECRET_KEY_BASE in /confirg/secrets.yml

production:
  secret_key_base: # add yours here

Hello here, I have some issues:

2015/06/01 18:48:07 [error] 82618#0: *5006 upstream prematurely closed connection while reading response header from upstream, client: 141.101.104.74, server: http://linux-notes.org, request: “POST /xmlrpc.php HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9000”, host: “http://linux-notes.org” 2015/06/01 18:48:08 [error] 82618#0: *5014 upstream prematurely closed connection while reading response header from upstream, client: 141.101.104.74, server: http://linux-notes.org, request: “POST /xmlrpc.php HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9000”, host: “http://linux-notes.org” 2015/06/01 18:48:11 [error] 82616#0: *4388 upstream prematurely closed connection while reading response header from upstream, client: 141.101.104.74, server: http://linux-notes.org, request: “POST /xmlrpc.php HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9000”, host: “http://linux-notes.org

Kindly, help me. I rebooted the php-fpm and nginx and it’s not solve me issue :( Thanks.

just restart php-fpm, it worked for me!