【发布时间】:2022-02-03 16:02:21
【问题描述】:
我在 Spring Boot 中遇到了一些与网关服务相关的问题。我有以下 .yml
#spring.profiles.active: local
server:
port: 80
#ssl:
# enabled: true # Uses self-signed certificate because no key-store configuration is specified.
internal.lb.uri: http://34.125.111.144
spring:
cloud:
gateway:
routes:
- id: customers
uri: ${internal.lb.uri}:9001
predicates:
- Path=/api/customers**
filters:
- RewritePath=/(?<path>.*), /$\{path}
- id: employees
uri: ${internal.lb.uri}:9000
predicates:
- Path=/api/employees**
filters:
- RewritePath=/(?<path>.*), /$\{path}
- id: suppliers
uri: ${internal.lb.uri}:9002
predicates:
- Path=/api/suppliers**
filters:
- RewritePath=/(?<path>.*), /$\{path}
- id: webapp
uri: ${internal.lb.uri}:9003
predicates:
- Path=/**
filters:
- RewritePath=/(?<path>.*), /$\{path}
当我运行它时,它运行完美!但是,一旦我尝试连接到 localhost,它会显示以下内容:
所以我不知道发生了什么!我找不到任何解决方案! 提前致谢!
【问题讨论】:
标签: spring spring-boot microservices spring-cloud-gateway