Consul only checks whether http port is running on node, not the actual port mentioned

I am not sure if this is a bug or not. I am following the tutorials Register a Service with Consul Service Discovery | Consul - HashiCorp Learn and since I have nginx running on port 80, the provided example actually passed health checks. However, changing configuration to port 8080 (which is not used) still shows the health check as passing. Even in the Web UI it seems to check only whether the node is working on port 80, and not the registered port. Is this the expected behavior?