我已经在 Cloud Foundry 中部署了 jHipster (v2.3),使用 jhipster subgenerator for cloud Foundry。此后,网关也成功部署。在部署过程期间或之后,日志跟踪中没有发现任何错误或问题,并且已在 CF 中创建了路由。
在jHipster Registry UI中注册的网关的图像
单击上面显示的网关的实例 URL 后,我收到以下错误:
502 Bad Gateway:注册的端点无法处理请求
网关中对应的日志是这样的:
"GET /favicon.ico HTTP/1.1" 502 0 67 "http://XXXXXXX/" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36" 10.146.54.251:50172 10.146.54.148:62452 x_forwarded_for:"10.23.3.122, 10.146.54.251" x_forwarded_proto:"http" vcap_request_id:f63848c7-c58f-47cf-6c5a-cabf007dcc31 response_time:0.003393796 app_id:1b4faa60-05ec-41d7-a075-fe391e688739 app_index:0
相应的注册表日志如下:
2017-07-09T17:12:41.961-04:00 [RTR/3] [OUT] - [09/07/2017:21:12:41.958 +0000] "PUT /eureka/apps/GATEWAY/bb95da05-b1c5-46b5-4718-463f8022fd36:Gateway:mbo-gateway-2.0.0:8082?status=UP&lastDirtyTimestamp=1499633621406 HTTP/1.1" 200 0 0 "-" "Java-EurekaClient/v1.4.10" 10.146.54.243:46930 10.146.54.133:64594 x_forwarded_for:"10.146.54.148, 10.146.54.243" x_forwarded_proto:"http" vcap_request_id:85431f6c-a916-45a5-7498-2fe012ae2338 response_time:0.002340557 app_id:17cfd70b-8fcd-4d15-bac7-cd4a5b73a976 app_index:0
application-cloudfoundry.yml 文件如下所示:
eureka:
instance:
prefer-ip-address: false
hostname: ${vcap.application.uris[0]}
nonSecurePort: 80
client:
enabled: true
healthcheck:
enabled: true
registerWithEureka: true
fetchRegistry: true
serviceUrl:
defaultZone: http://username:password@jhipsterregistry.XXXXXX/eureka
日志没有给出任何指示可能出了什么问题或我缺少什么参数。
如果我部署一个简单的微服务并通过 Postman 进行 REST 调用(绕过网关,请求会正常进行。这似乎是仅网关的问题。
有人可以建议或提供意见吗?
非常感谢!