1

When I try to restart nginx it says nothing like:

>sudo service nginx restart
>sudo service nginx restart

When I enter sudo nginx -t it alsy says nothing!

When I try reload my host page - I see 404 nginx error.

In error log I see

09:09:18 [error] 489#0: *3 connect() failed (111: Connection refused)
while connecting to upstream, client: 54.93.93.219, 
server: psy-spb.pro, request: "GET / HTTP/1.1",
upstream: "fastcgi://127.0.0.1:9000", host: "psy-spb.pro"

with also

07:53 [crit] 491#0: unlink() "/var/run/udev/data/+pci:0000:00:00.0" failed 
(13: Permission denied)
2016/04/16 09:07:53 [crit] 491#0: cache file "/var/run/initramfs/overlayroot.log"
is too small
2016/04/16 09:07:53 [crit] 491#0: unlink() "/var/run/initramfs/overlayroot.log"
failed (13: Permission denied)

The Question

  1. Why nginx restart says nothing?
  2. How could I fix connection refused and permission denied errors? Where I should look for?

My nginx.conf Sensitive strings:

        fastcgi_pass unix:/run/php/php7.0-fpm.sock;
#       fastcgi_pass    127.0.0.1:9000;

Another issue - I can't see any file in folder /run/php/, but fastcgi_pass is listening to php7.0-fpm.sock that is really does not exists in this folder.

Update #1

My nginx.conf on pastebin, my site config is on pastebin. **So I don't understand, why sock file is in my config but I see error that my host listens to fastcgi://127.0.0.1:9000

Thank you

  • Which OS do you use? Nginx probabaly works correctly. Another issue - I can't see any file in folder /run/php/, but fastcgi_pass is listening to php7.0-fpm.sock that is really does not exists in this folder. That's the actual issue. Please see the relevant material of your OS on how to make php-fpm to work. – Pothi Kalimuthu Apr 16 '16 at 14:19
  • Best guess is the errors you see in the log need to be resolved before you can start nginx. – Tim Apr 16 '16 at 20:16
  • Thank you, guys. @Pothi, I'm use Ubuntu 14.04 on AWS EC2. Nginx was worked correctly before I started updating it and modifying nginx.conf file. So my issue is php7.0-fpm.sock that is really does not exists in /run/php/ folder. Now I will try to find such an issues in relevant material to resolve this bug. – Ilya Rusin Apr 17 '16 at 10:16
  • What about this recipe? The answer was to not use a .sock file at all. in /etc/php-fpm.d/www.conf it has listen = 127.0.0.1:9000 so in my nginx config I put fastcgi_pass 127.0.0.1:9000; instead of using something like fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; as you can see in Stack Overflow php-fpm doesn't create .sock file – Ilya Rusin Apr 17 '16 at 10:19
  • As you are using Ubuntu, check the path /var/run/php/php7.0-fpm.sock – nidhi Apr 17 '16 at 10:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.