e7
1/12/2018 - 8:55 AM

capture location for nginx

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"