简体   繁体   中英

How to route all traffic to a single port on google compute engine

I'm hosting a node app on the google compute engine. My app is set to listen to the port 8080. I opened up a firewall to allow tcp connections to port 8080. I can connect to my app by entering

http://<your-instance-ip>:8080 

in the google chrome browser, where your-instance-ip is the external ip of the compute engine instance. I bought a domain. I want to make it so that when you enter my domain, it redirects you to this specific port . But you can only add the external ip in the A-record of my godaddy domain. How do I route all traffic to that ip, to the specific port 8080? I used nodejs with express. I want to do this using NGINX, could someone point out some tutorials?

Click on 'default' Network and Edit your "default-allow-http", make sure existing "Allowed protocols and ports" is "tcp:80" and target-tag is "http-server" also add "nodejs" in target-tag. Save your changes. Restart your google console. godaddy will listen the port 80

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM