3

I have a nodejs app in google compute engine which I can access with the given appspot adress.

In networking I set the ip adress as static. I have added a firewall rule for allow any trafic , tcp:8080.

But when I try to go onto external ip adress on my browser it fails to load. So I cannot acces my site with external ip adress.

What should I do to be able to use external IP adress?

2 Answers 2

2

So it seems like , when you use "gcloud preview app deploy" command it deploys to google cloud compute engine where the app is runing on port 8080.

To have a static IP to you project here are the steps to take:

1) In your code , create an app.yaml file. Forward port 80 to port 8080 (where your app is listening)

    network:
     forwarded_ports:
     - 80:8080

2) go head and deploy you app

   gcloud preview app deploy

3) In your google console go to NETWORKING > FIREWALL RULES and add new firewall rule for tcp:80

4) Go onto EXTERNAL IP ADDRESSES and change your apps IP address to static.

You will see your site runing on the external ip adress.

0

From your question, it seems like you're using Google App Engine to run your node.js application (given your mention of appspot.com domain).

If my assumption is correct, you don't need to assign any ip address to your instance/s - they all are managed by Google and the routing of requests from external world to your application is done by App Engine.

You should access your app just by your_app_name.appspot.com or if you wish to use your own, custom domain, please use this guide to achieve it. This will also help you to setup SSL, if you want/need it for your app.

4
  • I am using the 'compute engine' solution. SO even if i set the domain on the app engine part it doesnt work
    – Burak Gazi
    Mar 25, 2016 at 16:03
  • @BurakGazi - so, what does the "which I can access with the given appspot address" mean? Mar 25, 2016 at 16:46
  • In my console , it says 'App Engine' : 0 instances , 'Compute Engine' : 1 instances. I deployed my app with 'gcloud preview deploy app' command from terminal and it said 'Deployed module [default] to [https://<my-project-name>.appspot.com]'.
    – Burak Gazi
    Mar 26, 2016 at 8:36
  • @BurakGazi - you're using AppEngine, just not the standard sandbox but the "Managed VM" variant. My answer still applies, you need to use custom domain feature of AppEngine to map this to your domain (if you want/need). You won't be able to assign an IP to an instance in a way that would work. Mar 26, 2016 at 15:52

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.