Skip to content

Instantly share code, notes, and snippets.

@e7
Last active January 12, 2018 10:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save e7/e808e34afcfdebbb2e4813c3c560d1cc to your computer and use it in GitHub Desktop.
Save e7/e808e34afcfdebbb2e4813c3c560d1cc to your computer and use it in GitHub Desktop.
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"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment