3
votes

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

2 Answers

1
votes

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
votes

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.