如果你在路由中重新定义了path,那么你要增加filter StripPrefix,不然无法用指定的path调用。
[
{
"filters": [
{
"name": "StripPrefix",
"args": {
"_genkey_0": "1"
}
}
],
"id": "itdu-auth",
"order": 0,
"predicates": [{
"args": {
"pattern": "/auth/*"
},
"name": "Path"
}],
"uri":"lb://itdu-auth"
}
]
访问地址:http://localhost:8000/auth/index
或者直接在你的配置文件中使用:
- id: itdu-auth
uri: lb://itdu-auth
predicates:
- Path=/auth/**
filters:
- StripPrefix=1