【发布时间】:2017-01-26 18:51:29
【问题描述】:
我正在使用 docker 在两个容器中运行两个微服务,例如 demo1 和 demo2。我在demo1中配置了zuul。我想从demo1路由到demo2,也就是我想从demo1访问demo2中的api。
demo1 在端口 8080 上运行,demo2 在端口 8030 上运行,我想像这样访问 api-“localhost:8030/zuultest/test”。但是路由不起作用。如果我像“localhost:8080/test”一样访问demo1,它工作正常。
这是我在application.yml中的zuul配置-
server:
port: 8030
#TODO: figure out why I need this here and in bootstrap.yml
spring:
application:
name: zuul server
endpoints:
restart:
enabled: true
shutdown:
enabled: true
health:
sensitive: false
zuul:
routes:
zuultest:
url: http://localhost:8080
stripPrefix: false
ribbon:
eureka:
enabled: false
【问题讨论】:
标签: docker netflix-zuul