wuliws 发表于 2018-11-9 13:30:48

nginx location if 中使用proxy_pass

location^~ /  
{
  
    if ($request_uri ~ /)
  
    {
  
      set $bucketid $1;
  
    }
  
    if ($remote_addr ~* "192.168.114.146|192.168.114.145|192.168.114.144|192.168.11.51|192.168.11.125|192.168.58.3|192.168.11.42")
  
    {
  
      proxy_pass http://192.168.113.168:9085$1;
  
    }
  
    if ($remote_addr ~* "192.168.11.64")
  
    {
  
      proxy_pass http://192.168.113.167:9085$1;
  
    }
  
    include proxy.conf;
  
    access_log logs/web.log main;
  
}


页: [1]
查看完整版本: nginx location if 中使用proxy_pass