I had the same problem and tried almost every possible combination until I saw your comment that curl might not be installed. That was exactly my issue. After installing curl, CMD-SHELL, curl -f http://localhost/ || exit 1 works fine. Thanks!
curl
CMD-SHELL, curl -f http://localhost/ || exit 1