2014-12-24 5 views
0

두 개의 업스트림이 있다고 가정 해 봅시다 : upstream1upstream2.
또한 API 최종 금액이 /api/thing입니다.
나는 이런 식의 nginx에서 두 위치를 구성 할 : 위치에서Nginx 위치 구성

location /api/thing/? { 
      proxy_intercept_errors on; 
      proxy_pass http://upstream1; 
     } 

location /api/thing/* { 
      proxy_intercept_errors on; 
      proxy_pass http://upstream2; } 

내가 정기적으로 정규 표현식 (비의 nginx 구성 구문)를 사용 :/API/일에

  1. 요청/API/일? PARAM1 = VAL1 & PARAM2 = val2만큼, 등/API/일/subthing1? A = B/API/일/subthing2/등이 upstream2로 프록시해야
-
  • 요청 upstream1로 프록시해야

    nginx 구성 측면에서 가능합니까?

  • 답변

    0

    내가 작성합니다

    location = /api/thing { 
        # upstream1 
    } 
    
    location = /api/thing/ { 
        # upstream1 
    } 
    
    location /api/thing/ { 
        # upstream2 
    }