一、參考下面先搭建Eurakaspring
https://my.oschina.net/u/2441766/blog/3093044測試
二、添加依賴url
<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-zuul</artifactId> </dependency>
三、啓動類添加@EnableZuulProxy
,支持網關路由.net
四、添加配置3d
#這裏的配置表示,訪問/it/** 直接重定向到http://www.ityouknow.com/** zuul: routes: baidu: path: /myserver/demo/** url: http://127.0.0.1:8090/myserver/demo/
五、訪問測試code
http://127.0.0.1:8761/myserver/demo/testserver