0

We have setup a windows VM instance on gce for web server testing, with IIS and it works just fine: I can access my portal app from outside, since firewall has http/https traffic enabled by default, when VM was created.

However, we need to test it now with node.js and we can't access it from outside, when using the same http/https protocols. The simple test we have done is:

  • stop IIS to free http/https protocols
  • run node.js with this simple webserver app:

    var http = require('http');
    http.createServer(function (req, res) {
      res.write('Hello World!'); 
      res.end();
    }).listen(80, "0.0.0.0"); //the server object listens on port 80
    

We tested with several IPs addresses in the listener ("0.0.0.0", "127.0.0.1", internal_google_ip, external_google_ip, etc) but it doesn't work.

Does any body know if we need to setup any additional config in our VM instance like specific GCE network interfaces, firewall settings, etc? This should not occur since if its correctly mapped to handle IIS, it should also work with a simple node.js webserver.

By the way, if we config this in our internal company servers, if works just fine. Please help

1

As you mentioned when you create the instance for IIS you specifically have to select the option to allow the traffic, like this for it to work:

Firewall

Add tags and firewall rules to allow specific network traffic from the Internet

☑ Allow HTTP traffic

☑ Allow HTTPS traffic

This adds the tags "http-server" and "https-server" to your instance, and by default on your firewall rules, under "VPC NETWORK" you will have these two policies:

default-allow-http
Ingress 
http-server
IP ranges: 0.0.0.0/0
tcp:80  Allow   1000    
default

default-allow-https
Ingress 
https-server
IP ranges: 0.0.0.0/0
tcp:443 Allow   1000    
default

You can check out how to manage firewall policies with network tags, it can simplify the firewall rules management if used properly.

0

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...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.