1

我有两个上游命名frontendclusteradmincluster我想这样做:

如果请求 uri 包含/adminor/upload或请求方法,POST则使用 admincluster。否则代理传递给前端集群。

我怎样才能在我的 conf 文件中做到这一点?

4

1 回答 1

2

您可以在 nginx 中执行此操作,例如...

  location /admin {
    proxy_pass  http://backend;
  }

  location /upload {
    proxy_pass  http://backend;
  }

  if ($request_method = POST) {
    proxy_pass  http://backend;
  }
于 2012-02-02T07:14:55.187 回答