erarat
erarat

Reputation: 166

nginx request should go multiple locations

I am a newbie about nginx. I read some books but i did not find the answer. I found this but it is not my problem.(in my case , request go to first/location and then second/location)

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

Problem: i have several microservices. One of them is authentication service.Others are essential services. I want that when client create a request over the nginx, nginx first go to authentication service and then essential service. How can i do that?

Upvotes: 0

Views: 244

Answers (1)

C.A. Vuyk
C.A. Vuyk

Reputation: 1085

First use

location authentication/location  {
...
}

for the authentication service. At the end of the authentication set a redirect to

location essential_services/location  {
...
}

or to

location reject/location  {
...
}

Upvotes: 1

Related Questions