location ^~ /api/{ if($query_string ~ "type=1" ){ proxy_pass http://127.0.0.1:8080; break; } proxy_pass http://127.0.0.1:8089; }