Yes, your script is working.
I want it to use nginx. Please help to configure with it.
$ /usr/local/php7/bin/php -v
PHP 7.1.3 (cli) (built: Mar 31 2017 18:57:35) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.1.3, Copyright (c) 1999-2017, by Zend Technologies