0
votes

We have setup a windows 2012 server in a google compute engine (gce) virtual instance, for web hosting. The windows server has installed IIS 8.5 and we can access with no problem, any web asp.net app we install on it, both for HTTP and HTTPS protocols (installed by default during gce vm creation).

Now we need to test a simple node.js web server on the same machine, so we performed the following tasks: - stop IIS in order to free http (80) and https (443) ports - run a simple node.js http server example like:

var http = require('http');

http.createServer(function (req, res) {
    res.writeHead(200, {'Content-Type': 'text/plain'});
    res.end('Hello World!');
}).listen(80);

This example works fine if we run it locally inside the vm, but not outside from the internet. This worked just fine with IIS, both internally and externally...

Any ideas why its no working with node.js? Are we missing any additional customization (network?, firewall? etc) in gce console?

1

1 Answers

0
votes

After some analysis the problem was solved easily: we just add a firewall rule to allow http/https traffic (80 and 443 ports), and voila!

It seems that somehow, gce automatically adds firewall exceptions when we activate the http/https access during gce virtual machine creation. However, we can't find this exceptions in firewall config, which made the problem difficult to understand...