How to hide PHP 5/7 version when using Nginx

Originally published at: https://www.cyberciti.biz/faq/hide-php-version-nginx-on-linux-unix-server/

I am using PHP 5.6.xx and Nginx server on an Apline Linux server. I want to hide ‘X-Powered-By: PHP/5.6.32’ or ‘x-powered-by: PHP/7.3.6’ HTTP header. How can I hide PHP version when using Nginx along with PHP-fpm5 or PHP-fpm7?