1
# grep pm.status_path /etc/php5/fpm/pool.d/www.conf
pm.status_path = /fcgi-status

nginx config:

location ~ ^/(fcgi-status|ping)$ {
     access_log off;
     allow 127.0.0.1;
     deny all;
     fastcgi_param SCRIPT_FILENAME /path/$fastcgi_script_name;
     fastcgi_pass unix:/var/run/php-fastcgi/php-fastcgi.socket;
}

fastcgi_param and fastcgi_pass are the same as for the website which works.

php-fastcgi and nginx were restarted, but:

# curl http://127.0.0.1/fcgi-status -i
HTTP/1.1 404 Not Found
Server: nginx/1.10.1
Date: Tue, 18 Oct 2016 08:10:03 GMT
Content-Type: text/html
Transfer-Encoding: chunked
Connection: keep-alive
X-Powered-By: PHP/5.5.9-1ubuntu4.20

No input file specified.

This is not duplicate of this question because the error is not 'File not found' (perhaps nginx was unable to find the path) but 'No input file specified'. Please note there is php header in the response, so the answer came not from nginx but from php-fpm.

This is the only pool on the server.

What am I doing wrong?

Putnik
  • 2,095
  • 3
  • 23
  • 40

2 Answers2

0

Your fastcgi_param SCRIPT_FILENAME has a path prefix in it, however in php-fpm configuration you don't have a prefix.

So you need to change either one so that they are the same.

Tero Kilkanen
  • 34,499
  • 3
  • 38
  • 58
  • 'path' here is file path, like /home/site/docroot. Tried `fastcgi_param SCRIPT_FILENAME $fastcgi_script_name;` and `fastcgi_param SCRIPT_FILENAME /$fastcgi_script_name;`, no luck. Or I should use something different? – Putnik Oct 18 '16 at 11:53
  • Did you try just `fastcgi_param SCRIPT_FILENAME /fcgi-status`? – Tero Kilkanen Oct 18 '16 at 13:05
  • have just tried, doesn't work. – Putnik Oct 18 '16 at 13:24
0

Eventually found: I messed fpm and fast-cgi. The config changes were made in fpm, but I run fast-cgi.

Putnik
  • 2,095
  • 3
  • 23
  • 40