获取context-path优化

This commit is contained in:
tanghc
2020-01-02 10:11:27 +08:00
parent 0db69a88bf
commit 0774e52cc9
7 changed files with 40 additions and 9 deletions

View File

@@ -108,7 +108,18 @@ ribbon.ReadTimeout: 60000
微服务项目定义了`server.servlet.context-path=/story-service`,同时必须指定:
```properties
spring.cloud.nacos.discovery.metadata.server.servlet.context-path=${server.servlet.context-path}
spring.cloud.nacos.discovery.metadata.context-path=${server.servlet.context-path}
```
yml配置如下
```yaml
spring:
cloud:
nacos:
discovery:
metadata:
context-path: ${server.servlet.context-path}
```
不然网关无法拉取路由信息