nginx location if 에서 proxy 사용pass

최근 테스트 는 nginx 에서 고정 IP 를 통 해 특정한 주 소 를 방문 하 는 방법 을 테스트 합 니 다.더 이상 말 하지 않 고 코드 를 직접 올 립 니 다.
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;
}

좋은 웹페이지 즐겨찾기