码迷,mamicode.com
首页 > 编程语言 > 详细

SpringCloud

时间:2018-01-22 11:11:17      阅读:215      评论:0      收藏:0      [点我收藏+]

标签:static   tail   zone   www.   boot   serve   eid   csdn   str   

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

标签:static   tail   zone   www.   boot   serve   eid   csdn   str   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!