2012-03-14 4 views

答えて

1

は、あなたがそのような何かを試してみました(正規表現の初心者として)私のナットを駆動する、同様の条件で一致しなければならないことを要求されます:その方法

$HTTP["url"] =~ "^/subdirectory/_different_end_points_.json" { 
    proxy.server = (
    "/" => (("host" => "127.0.0.1", "port" => 9001)) 
) 
} 
else $HTTP["url"] =~ "^/_different_end_points_.json" { 
    proxy.server = (
    "/" => (("host" => "127.0.0.1", "port" => 9002)) 
) 
} 

で始まり、/subdirectory/_different_end_points_.jsoまたは(elseで)/_different_end_points_.jsonで始まる各URLと一致します。

しかし、本当にあなたのURLは本当に正規表現で始まるようにしてください!つまり、h * tp://sample.com/subdirectory/_different_end_points_.jsonとh * tp://sample.com/_different_end_points_.json

関連する問題