1
0
Code Issues Pull Requests Packages Projects Releases Wiki Activity GitHub Gitee

Gateway配置文件

This commit is contained in:
2022-11-06 00:18:46 +08:00
parent 529ef7528e
commit 7ec7fc1e4f
6 changed files with 68 additions and 3 deletions

View File

@@ -0,0 +1,13 @@
package com.cxyxiaomo.epp.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class Controller {
@RequestMapping("/error")
public String error() {
return "[ERROR] 500 Internal Server Error";
}
}

View File

@@ -15,7 +15,27 @@ spring:
enabled: true
lower-case-service-id: true
routes:
- id: test
uri: lb://microservice-provider-test-8011
- id: test1
uri: lb://microservice-provider-test
predicates:
- Path=/test/**
- Path=/test/**,/test1/**
- Method=GET,POST
filters:
- StripPrefix=1 # 跳过第一段 /test
- id: test2
uri: lb://microservice-provider-test
predicates:
- Path=/test2/{routes}
filters:
- SetPath=/hi/{routes}
- id: test3
uri: lb://microservice-provider-test
predicates:
- Path=/test3/**
filters:
- name: RedirectTo
args:
status: 302
url: https://www.baidu.com/?wd=