Yes, I would expect that to work. If you give it a try, what happens?
Some other details you might want to think about are whether the ports are blocked by firewalls on the network. For default AWS and GCE instances, there may be default rules on the network you need to configure.
You might find it easiest to leave it on port 80, while using the local network IP.