deploy app on appengine on port 8761

2020-03-03 07:48发布

I'm deploying a Java app that runs on port 8761, and works fine on localhost.
Although when I push to App Engine flexible environment, I get a HTTP 502 server error.

Here is my app.yaml:

runtime: java
env: flex

service: eureka

runtime_config:
  jdk: openjdk8

handlers:
- url: /.*
  script: ignore
  secure: always

manual_scaling:
  instances: 1

resources:
  cpu: 1
  memory_gb: 2

The log from gcloud is fine, server is running, but my request doesn't seems to hit the app at all.

I noticed that if I run on port 8080, it works. For now, it is not a problem change the default port to 8080, but I would like to understand why I'm not able to run it on 8761

1条回答
Anthone
2楼-- · 2020-03-03 08:19

I think you need to use the network settings section in the app.yaml config file:

network:
  forwarded_ports:
    - 8761/tcp

You might also need to set firewall rules in the Cloud Platform Console.

查看更多
登录 后发表回答