I think you are mixing up a few things here. A ping test works using ICMP and will therefore only check network-layer connectivity.
nmap -p will simply check whether there is some process listening on that port. Therefore it checks transport-layer end-to-end connectivity.
What you seem to be trying to achieve is to check if there is a process responding with HTTP traffic, right? If that is all you want to do, then you could simply consider to create a HTTP (or HTTPS) request using
curl. Depending on what you are trying to inspect about that HTTP endpoint you could parse specific information from the response. For example, although curl may return an HTTP response, this does not mean that the remote host considers the request successfull. To determine that, you would need to check the response code or body.