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/