首页 > 编程语言 > 详细

SpringCloud

时间:2018-01-22 10:10:39      阅读:237      评论:0      收藏:0      [点我收藏+]

http://www.ityouknow.com/springcloud/2017/06/01/gateway-service-zuul.html
http://blog.csdn.net/forezp/article/details/69939114

spring.application.name=gateway-service-zuul zuul注册中心
server.port=8888

zuul.routes.baidu.path=/it/**
zuul.routes.baidu.url=http://www.ityouknow.com/ 直接进行转发

zuul网关的启动类
@SpringBootApplication
@EnableZuulProxy 启动类添加@EnableZuulProxy,支持网关路由
public class GatewayServiceZuulApplication {

public static void main(String[] args) {
    SpringApplication.run(GatewayServiceZuulApplication.class, args);
}

}
启动gateway-service-zuul-simple项目,在浏览器中访问:http://localhost:8888/it/spring-cloud
看到页面返回了:http://www.ityouknow.com/spring-cloud 页面的信息,如下:

spring.application.name=gateway-service-zuul
server.port=8888

zuul.routes.api-a.path=/producer/**
zuul.routes.api-a.serviceId=spring-cloud-producer

eureka.client.serviceUrl.defaultZone=http://localhost:8000/eureka/

SpringCloud

原文:https://www.cnblogs.com/websongt/p/8327631.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!