CentOS Nginx PHP-fpm: how to fix error: connect() to 127.0.0.1:9000 failed (13: Permission denied) while connecting to upstream


CentOS Nginx PHP-fpm: how to fix error: connect() to 127.0.0.1:9000 failed (13: Permission denied) while connecting to upstream

Step 1: Check error.log

[root@tutorialspots ~]# tail /var/log/nginx/error.log
2020/10/04 16:16:25 [crit] 45005#0: *1 connect() to 127.0.0.1:9000 failed (13: Permission denied) while connecting to upstream, client: 116.97.42.111, server: _, request: "GET /phpinfo.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "139.180.196.31"

Step 2: Solution: disable SELinux for Nginx
semanage permissive -a httpd_t

Done!

Leave a Reply