springcloud--ruul(路由网关)
2021-06-17 13:05
标签:依赖 provider host [] 过滤 过滤器 服务 hello enable Zuul的主要功能就是路由转发和过滤器 实例: 1:添加依赖pom.xml: 2:配置文件: server: 3:启动类: @SpringBootApplication public static void main(String[] args) { SpringApplication.run(App.class, args); } } springcloud--ruul(路由网关) 标签:依赖 provider host [] 过滤 过滤器 服务 hello enable 原文地址:https://www.cnblogs.com/niexinlei/p/9720363.html
spring-cloud-starter-netflix-eureka-client
spring-boot-starter-actuator
spring-cloud-starter-netflix-zuul
port: 8888
spring:
application:
name: zuul-gateway
eureka:
client:
service-url:
defaultZone: http://localhost:9001/eureka/
instance:
instance-id: zuul-8888
prefer-ip-address: true
zuul:
prefix: /nxl
ignored-services: "*" #屏蔽指定的服务
routes:
hello-route:
#微服务名字,提供者的名字
service-id: provider-one
path: /aaa/**
@EnableZuulProxy
public class App {