gulimall-gateway网关使用案例 想要实现针对于“http://localhost:88/hello?url=baidu”,转发到“https://www.baidu.com”,针对于“http://localhost:88/hello?url=qq”的请求,转发到“https://www.qq.com/”
创建“application.yml”spring:
cloud:
gateway:
routes:
- id: test_route
uri: https://www.baidu.com
predicates:
- Query=url,baidu
- id: qq_route
uri: https://www.qq.com
predicates:
- Query=url,qq
启动“gulimall-gateway”进行测试
访问:http://localhost:88/hello?url=baidu
访问:http://localhost:88/hello?url=qq 之所以会显示不存在, 是因为实际访问的是 qq.com/hello