capture location for nginx
location /capture/ {
  internal;
  rewrite ^/capture/(https?)/([^/]+)/(\d+)/(.*) /$4 break;
  proxy_pass $1://$2:$3;
}
usage like this:
  -- url: http://www.hejizhan.com/s/forum.php
  ngx.location.capture("/capture/http/www.hejizhan.com/80/s/forum.php"