nginx请求应该去多个位置

问题描述 投票:0回答:1

我是关于nginx的新手。我看了一些书,但我找不到答案。我找到了这个,但这不是我的问题。(在我的情况下,请求转到第一个/位置然后第二个/位置)

location ~ ^/(first/location|second/location)/  {
...
}

问题:我有几个微服务。其中之一是身份验证服务。其他是必不可少的服务。我希望当客户端通过nginx创建请求时,nginx首先转到身份验证服务,然后是基本服务。我怎样才能做到这一点?

nginx nginx-location nginx-reverse-proxy
1个回答
1
投票

首次使用

location authentication/location  {
...
}

用于身份验证服务。在身份验证结束时设置重定向到

location essential_services/location  {
...
}

或者

location reject/location  {
...
}
© www.soinside.com 2019 - 2024. All rights reserved.