The instance is a Windows Server 2016. It runs an Apache server (for the ports 80 and 443), and a GlassFish server (on ports 8080 and 8181). On the machine itself, everything seems to work fine when I invoke localhost:.
I mapped the public IP of the instance to a DNS. When I invoke it with the Apache's ports it works fine, but not with the GlassFish ports. Same result when I use the public IP as well.
I tried to configure the Virtual host parameter directly from the GlassFish console (localhost:4848) and also the solution in here, without success. What am I missing here?
It was a firewall issue. Although I added inbound rules to allow for ports 8080 and 8181 explicitly, this wasn't enough.
I had to check a bit more (following the hint of @OndroMih in the comments of the post), and by disabling some sections of the firewall, it appeared that the Private Profile was the blocking one. Hence I disabled it.
Not sure what are the implications of that, but it solves my problem for now.