amarao (amarao_san) wrote,
amarao
amarao_san

nginx magic

location ^(foo|bar|baz|toomany)/(.*){
    $type=$1;
    $id=$2;
    rewrite ^.+ /path/request;
}
location /path/request{
    proxy_pass 127.0.0.1:80/path/request?type=$type&id=$id;
}

Надеюсь, кто работал с nginx оценят возможность таки засунуть слешованный proxy_pass в регэксповый location.
Tags: howto, nginx
Subscribe

  • Post a new comment

    Error

    default userpic

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 6 comments